Try encoding “café ☕” with plain btoa() in your browser console and
you’ll get a DOMException — not a bug in your code, a limitation
baked into the function itself. btoa() assumes one byte per character
and simply can’t represent anything outside Latin-1.
Our new Base64 encoder/decoder fixes
that properly: it runs your text through TextEncoder to get correct
UTF-8 bytes first, then Base64-encodes those bytes. Decoding reverses
the same path with TextDecoder. The result: café ☕ 日本語 round-trips
exactly, no mangled characters, no thrown exceptions.
A few things worth knowing:
- It’s an encoding, not encryption. Base64 has zero security value — anyone can decode it instantly. Never rely on it to hide anything.
- Invalid input fails cleanly. Decode garbage Base64 and you get a clear error message, not a crash.
- Text only, by design. This tool doesn’t handle file uploads — it’s built for the common case of encoding or decoding text.
As always, everything runs in your browser — nothing you type or paste is sent anywhere.