Base64 Encoder and Decoder
Encode text to Base64 and decode it back, with correct Unicode handling and a URL-safe variant.
Convert text to Base64 and back. Handles Unicode correctly (not just ASCII).
Result
✓ Ready to encode.
SGVsbG8sIERldktpdCEgQ2Fmw6kgw5E=About the base64 encoder and decoder
Base64 turns binary data into ASCII so it can travel through text-only channels. The classic bug is that the browser's btoa only handles Latin-1, so any emoji or non-Latin character throws an error. This tool encodes through UTF-8 bytes first, which handles every character correctly.
The URL-safe variant swaps + and / for - and _ and drops the padding, which is what JWTs and query parameters use.
How to use it
- 1Choose encode or decode.
- 2Paste your text.
- 3Turn on URL-safe output if it will go in a URL or a token.
- 4Copy the result.
Questions
Why does encoding emoji fail elsewhere?
Plain btoa only accepts Latin-1 characters. Encoding the string to UTF-8 bytes first is what makes emoji and non-Latin scripts work, which is what this tool does.
Is Base64 encryption?
No. It is encoding, fully reversible by anyone. Never use it to protect anything.
What is URL-safe Base64?
A variant using - and _ instead of + and /, with padding removed, so the string survives being placed in a URL.