Base64 Encoder & Decoder
Convert text to Base64 and back. Unicode is handled correctly, URL-safe output is one click away, and missing padding on a truncated string is repaired automatically.
Text or Base64
Everything is processed in your browser — nothing is uploaded.
Base64 is encoding, not encryption
This needs saying because the mistake is common and expensive: Base64 provides no confidentiality whatsoever. Anyone can decode it instantly, including this page. It exists to move binary data safely through channels that only accept text — email bodies, JSON fields, HTML attributes, URLs. Putting a password in Base64 protects nothing.
The Unicode trap
The browser's native btoa function throws an error on any character above code point 255, so naive implementations break on accented Latin, Vietnamese, Chinese or emoji. The correct approach encodes the text as UTF-8 bytes first and then Base64-encodes those bytes. This page does that, so "Xin chào" and "🎯" round-trip cleanly instead of failing.
Standard versus URL-safe
Standard Base64 uses + and /, both of which have reserved meanings in URLs — + is often read as a space in query strings. The URL-safe variant defined in RFC 4648 substitutes - and _ and usually drops the trailing = padding. JSON Web Tokens use this variant, which is why a JWT never contains a plus sign.
Why the output is about a third larger
Base64 packs every three bytes into four printable characters, so encoded data is roughly 133 percent of the original size, plus padding. That overhead is the price of text safety. Embedding a large image as a data URI in a stylesheet is convenient but makes the file a third bigger and blocks it from being cached separately.