Base64 encoder and decoder
Convert text to Base64 and back, with correct handling of accented characters and emoji.
Runs entirely in your browser. Nothing is uploaded.
What Base64 is for
Base64 represents binary data using 64 printable characters. It exists because several older protocols — email being the original case — could only carry text safely. Encoding makes data survive those channels intact.
Common uses: embedding small images in CSS or HTML as data URLs, carrying binary payloads inside JSON, basic HTTP authentication headers, and the three segments of a JSON Web Token.
What Base64 is not
It is not encryption and provides no security whatsoever. Anyone can decode it instantly — this page does it with one function call. If you find credentials stored Base64-encoded in a configuration file, treat them as plain text, because that is what they are.
Size and Unicode
Encoding inflates data by roughly 33%: every three bytes become four characters. That matters when inlining images — below about 5 KB the saved HTTP request is usually worth it, above that a normal file reference wins.
The browser's built-in btoa only accepts characters in the Latin-1 range, so accented characters and emoji throw an error. This tool converts to UTF-8 first, which is why "café" and "日本語" encode and decode correctly here.
URL-safe variants
Standard Base64 uses + and /, both of which have meaning in URLs. The URL-safe variant substitutes - and _ and usually drops the = padding. JWTs use that variant, which is why pasting a raw token segment into a strict decoder sometimes fails.
Questions
Can I encode a file?
This tool handles text. For files, most languages offer a one-line conversion, and browsers can read a file to a data URL with FileReader.
Why does my decoded text look like symbols?
The input was probably binary data rather than text, or it used a different character encoding. Base64 preserves bytes; it does not know what they mean.
More tools
Browse all free developer tools or read the guides.