Base64 Encoder / Decoder
Encode and decode Base64. Handles emoji and accents correctly.
Why encoding emoji or accented text sometimes fails elsewhere
The plain JavaScript function most Base64 tools are built on,
btoa, only understands one byte per character and
throws an error the moment it sees anything outside that range —
which includes emoji, most accented letters, and any non-Latin
script. Text is converted to its real UTF-8 bytes first here, so
"café ☕" or "🚀" encode correctly on the first try instead of
throwing InvalidCharacterError or silently mangling
the result.
Standard vs URL-safe, and missing padding
Two Base64 alphabets exist because the standard one uses
+ and /, both of which have their own
meaning inside a URL. URL-safe Base64 swaps those for
- and _ instead — the form used inside a
JWT, for instance. Decoding auto-detects which alphabet is in use,
and pads the input back out if the trailing =
characters were stripped, which is common in contexts like JWTs
that omit padding entirely.
The encoder and decoder side by side
Both directions run at once in separate panels rather than one shared box that has to be told which way to go each time. A swap button sends the encoder's output into the decoder's input and back, which is a quick way to confirm a round trip produces the original text exactly.
Privacy
Encoding and decoding both happen in your browser. Nothing you paste, drop, or load from a file is sent to a server.