Base64 encoder and decoder
Developer tools
Paste text to encode, or Base64 to decode. The direction switches automatically.
Runs in your browser
Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.
About this tool
Base64 is not encryption
It is an encoding: a way of writing arbitrary bytes using 64 printable characters, so they survive being put in a URL, an email header or a JSON string.
It is trivially reversible by anybody, with no key. A password or a token in Base64 is a password in plain text with an extra step. If you need secrecy, you need encryption.
Why so many Base64 tools break on "café"
btoa throws on any character above U+00FF, so naive tools fail on accented text, Arabic, Japanese and every emoji.
The fix is to encode the text as UTF-8 bytes first and Base64 those bytes, which is what this does. Encoding and decoding round-trip exactly for any text in any script.
URL-safe Base64
Standard Base64 uses + and /, which both have meaning in a URL, and pads with =, which has meaning in a query string.
The URL-safe variant (RFC 4648 §5) substitutes - and _ and drops the padding. JSON Web Tokens use it, which is why a JWT contains no plus signs. The decoder here accepts both and restores the padding itself.