Base64 encoder/decoder
Encode/decode Base64 and turn images into data URIs.
A config file wants a value Base64-encoded. A log line is a wall of letters ending in == and you need to see what it actually says. Or you want a small icon inline in CSS instead of as another HTTP request. This tool covers all three, entirely in the browser.
How it works
Text in both directions
Encode → turns whatever is in the left box into Base64. ← Decode does the reverse, ignoring surrounding whitespace. Swap moves the result back into the input so you can chain steps, and Copy result takes the output to your clipboard. If decoding fails, the input was not valid Base64 — a truncated string or a stray character is the usual cause.
Non-ASCII text is handled correctly
Text is converted to UTF-8 bytes before encoding, and back again after decoding, so accented letters, Korean and emoji survive the round trip. A bare btoa() call in a browser console throws an error on those characters; this tool does not.
Images to data URIs
Pick a file with the image selector and it becomes a data: URI — the full string, with its MIME type and the ;base64, prefix — alongside a preview so you can confirm you chose the right file. Paste it into a CSS url(), an <img src>, or an email template.
Base64 grows the payload by roughly a third, so inline images make sense for small icons rather than photographs. And note what this is not: Base64 is an encoding, not encryption. Anyone can reverse it, so never use it to hide a secret.
Terms explained
- Base64
- A scheme that represents arbitrary bytes using 64 printable characters, so binary data survives text-only channels.
- Padding (=)
- One or two `=` characters at the end, padding the data out to a multiple of three bytes.
- Data URI
- A URL that carries the file itself, like `data:image/png;base64,...`, instead of pointing at one.
- UTF-8
- The byte encoding applied to text before it is Base64-encoded, which is what preserves non-English characters.
- MIME type
- The label describing what the data is, such as `image/png`, included at the start of a data URI.
Frequently asked questions
Is Base64 a form of encryption?
No. It is a reversible encoding with no key, and anyone can decode it in seconds. It exists to move binary data through text-only channels such as email or JSON, not to protect it.
Why does my decode fail?
Usually the string is incomplete, has been wrapped across lines, or contains a character outside the Base64 alphabet. Copying only part of a long token is the most common cause — check that the ending, including any `=` padding, came along.
Are my uploaded images sent anywhere?
No. The file is read by your browser and converted locally; nothing is uploaded. The resulting data URI exists only on your screen and clipboard.
How much bigger does Base64 make a file?
About 33% larger, plus a little overhead. A 30 KB icon becomes roughly 40 KB of text, which is why data URIs suit small assets rather than photos.
What is the difference between Base64 and Base64URL?
Base64URL swaps `+` and `/` for `-` and `_` so the result is safe inside a URL or filename. JWTs use that variant, so if a string has `-` or `_` where you expected `+` or `/`, that is why.
Tell us what went wrong and we'll fix it fast. (Leave an email if you'd like a reply.)