How to Encode and Decode Base64 (Including Emoji and Arabic)
2026-07-31
Base64 exists because much of the internet was built for text. Email bodies, JSON documents, XML attributes and HTTP headers all assume printable characters, so anything binary has to be re-expressed in a safe alphabet before it can pass through them.
Step by step
- Open the Base64 Encoder & Decoder.
- Choose encode or decode.
- Paste your text. The result appears as you type.
- Copy it, or download it as a text file.
The Unicode problem
This is where most browser-based Base64 tools fail. JavaScript's built-in btoa function only understands Latin-1, so anything containing emoji, Arabic, Chinese, Cyrillic — or even a curly quote pasted from Word — throws an error rather than encoding.
The fix is to convert the text to UTF-8 bytes before encoding and decode back through UTF-8 afterwards, which is what this tool does. Any text encodes correctly and round-trips byte for byte.
Standard versus URL-safe
Standard Base64 uses + and /, both of which have meaning inside a URL, and pads with =. The URL-safe variant swaps them for - and _ and drops the padding, so the result can sit in a URL or a filename untouched. JWTs use this variant. The decoder here accepts either and restores missing padding automatically, so you never have to know which one you were given.
Base64 is not encryption
It is worth repeating because it causes real security incidents. Base64 is an encoding, not a cipher. Anyone can decode it instantly — this page demonstrates exactly that. Never use it to protect a password, an API key or anything else that matters. Use it to move data safely, and use real cryptography to protect it.
Why the output is bigger
Base64 represents every three bytes as four characters, so output is about 33% larger than input. That overhead is the price of being safe to transmit as text, and it is why inlining large images as data URIs is usually a mistake.