Base64 encode & decode. Every byte stays on your device.
Encoding is UTF-8 safe, emoji and accented characters round-trip correctly.
File → Base64
or click to browse (any type)
🔒 Files never leave your browser. Nothing is uploaded.
Base64 → File
Base64, without leaving the page
Type in the plain-text pane and the Base64 pane fills in as you type, UTF-8 handled correctly, so emoji and accented characters round-trip intact. Paste Base64 the other way and decode it back; the decoder tolerates URL-safe characters, data: URI prefixes, wrapped lines and missing padding automatically. Switch to the File tab to drop any file up to 25 MB and get its Base64 plus a ready-to-paste data: URI, or paste Base64 and download the original file it encodes. Everything happens locally on your device, no upload, no sign-up, and it keeps working offline.
How to use the Base64 Encode/Decode tool
This tool converts text and files to Base64 and back. Text is turned into UTF-8 bytes first, so accented letters and other scripts survive the round trip, and the decoder accepts URL-safe characters, data: URIs, wrapped lines and missing padding. It is for developers working with tokens, API payloads, data: URIs and email or PEM blocks.
Step by step
-
Encode text as you type
On the Text tab, type or paste into the plain text pane. The base64 pane fills in about a quarter of a second after you stop typing. You can also press Encode, or Sample text to load a short UTF-8 test string.
-
Decode Base64 back to text
Paste Base64 into the base64 pane and press Decode. Decoding only runs when you press the button. If you then type in the plain text pane, the live encoder replaces the base64 pane again.
-
Pick an output format
Tick URL-safe to swap "+" and "/" for "-" and "_" and drop the = padding. Tick Wrap at 76 (MIME/PEM) to break the output into 76 character lines. Tick data: URI prefix to get a ready data:text/plain URI. When data: URI prefix is on, wrapping is skipped because a data: URI must stay on one line.
-
Copy or reset
Press Copy text or Copy Base64 to copy either pane. Press Clear to empty both panes and start again.
-
Encode a file
Switch to the File tab and drop a file on Drop a file, or click it to browse. Any type works, up to 25 MB. You get the Base64 and a data: URI built from the file type, each with its own Copy button, plus Download .txt of Base64 for long outputs.
-
Turn Base64 back into a file
On the right of the File tab, under Base64 → File, paste the Base64 or a full data: URI. Set the output filename (the default is decoded.bin) and press Decode & download.
Reading the result
- The small counter above the plain text pane shows its size in UTF-8 bytes, and the one above the base64 pane shows the number of Base64 characters. Hello is 5 B and encodes to SGVsbG8= at 8 chars, or SGVsbG8 with URL-safe on.
- Base64 is always about a third larger than the input, because every 3 bytes become 4 characters, padded with = to a multiple of 4.
- If the decoded bytes are not valid UTF-8 text, the plain text pane shows a hex preview of the first 64 bytes instead of garbled characters. That means the Base64 holds a file, so decode it on the File tab.
- After you add a file, the line under its name shows the file size, its type and the length of the Base64. After Decode & download, the line under the button shows the decoded size and the filename used.
Tips and common mistakes
- Base64 is an encoding, not encryption. Anyone can decode it, so do not treat a Base64 string as a way to hide a password or key.
- Use URL-safe for anything that goes into a URL, a JWT or a filename. Use the standard alphabet for data: URIs, basic auth headers and email.
- When you paste a data: URI for a PNG, JPEG, GIF, WebP, SVG, PDF, JSON, plain text, ZIP or CSV file, the output filename extension is filled in for you as long as the name still starts with decoded.
- Keep data: URIs for small assets such as icons. They are a third larger than the file and cannot be cached on their own.
- Wrap at 76 (MIME/PEM) also applies to the file Base64 and the downloaded .txt, but never to the data: URI. URL-safe and data: URI prefix only change the Text tab output; file Base64 always uses the standard alphabet.
Privacy and limits
Encoding and decoding run in your browser with its built-in Base64, TextEncoder, TextDecoder and FileReader functions. Nothing you paste or drop is uploaded, and nothing is saved after you close the tab. Files over 25 MB are refused.
Every Base64 job, one page.
- Encode any text to Base64 in real time, with full UTF-8 support for emoji, accented letters and non-Latin scripts.
- Decode Base64 back to plain text, automatically handling URL-safe characters, data: URI prefixes and missing padding, with a hex preview instead of mojibake when the bytes are binary.
- Convert any file to Base64 by dropping it on the File tab, with an instant preview for image files.
- Generate a data: URI from any file, ready to paste into HTML, CSS or Markdown with no extra HTTP request.
- Download a decoded file by pasting Base64 or a full data: URI and clicking Decode & download, the filename extension is even suggested from the MIME type.
- Switch to URL-safe mode for JWTs, OAuth tokens and signed URLs, or wrap output at 76 characters for MIME and PEM blocks.
Frequently asked questions.
Is the data I paste sent anywhere?
What's the difference between standard and URL-safe Base64?
Why is my decoded UTF-8 garbled?
How do I encode a binary file?
What's the "Wrap at 76" option for?
Why does Base64 of a 100-byte string take 136 characters?
Published · Last updated .