Base64 Encoder & Decoder — With Unicode Support
Encode text to Base64 or decode it back — proper UTF-8 handling so non-ASCII characters don't corrupt. Runs entirely in your browser.
Last reviewed 2026-10-19. Rates change — verify against the official sources linked below before relying on these figures.
What this is based on
- UTF-8 aware — emoji and non-ASCII text encode/decode correctly (the naive atob/btoa path corrupts them).
- Standard Base64 alphabet (+/=). Base64URL (- and _) used in JWTs and filenames isn't auto-detected — swap characters if decoding fails.
- Everything runs locally in your browser — pasted content is never uploaded, logged or stored.
Why Base64 makes things 33% bigger
Base64 stores 3 bytes in 4 ASCII-safe characters — it's a transport encoding for moving binary data through text-only channels (email, JSON, URLs, HTML attributes), not a compression or encryption format. Every API that embeds an image or file as a string pays that 33% tax.
Which is also the answer to 'is Base64 secure?': it's obfuscation at best — anyone can decode it instantly. Never store secrets as 'encoded' Base64 and assume they're protected.
The Unicode trap in btoa/atob
The browser's built-in atob() and btoa() work on bytes, not characters — feed btoa() a string with anything above \u00ff and it throws or corrupts. The correct path is TextEncoder → bytes → btoa for encoding, and atob → bytes → TextDecoder for decoding. This tool does exactly that, which is why '你好' and emoji round-trip correctly here.
Base64 vs Base64URL — the one-character difference
JWTs and URLs use Base64URL: the same encoding with +→-, /→_, and no = padding, so the output survives URLs and filenames unencoded. If a Base64 string with - or _ fails to decode, it's Base64URL — replace the characters and try again.
Frequently asked questions
- How do I decode Base64?
- Select 'Decode ← Base64' above and paste — whitespace is ignored. If it fails with weird characters, it's likely Base64URL: swap - for + and _ for /.
- Is Base64 encryption?
- No — it's encoding, not encryption. Anyone can decode it instantly; never treat Base64 as a way to hide secrets.
- Why is my decoded output garbled?
- Usually a charset issue — the tool decodes as UTF-8. If the source was encoded as Latin-1 or another legacy encoding, text will look wrong; binary data isn't meant to be read as text at all.
- Can I encode a file or image?
- This tool handles text. For files, your OS is faster: certutil -encode on Windows, base64 <file> on Linux/macOS.
Related calculators
Paste a JWT and instantly see its header, claims and expiry — decoded entirely in your browser. No upload, no sign-up, nothing leaves your device.
Percent-encode or decode strings, and break any URL into protocol, host, path, query params and fragment — decoded params listed cleanly.
Paste JSON to validate and pretty-print it — with error location (line and column) when it's broken, plus key count, depth and size stats. Runs entirely in your browser.