Base64 Encode / Decode
Encode and decode Base64 with full Unicode support and URL-safe output.
Start typing above and the result appears here.
How to use Base64 Encode / Decode
Paste your text or Base64
The tool detects which direction you want by default.
Switch to URL-safe if the result goes in a URL
Standard Base64 contains + and /, which have to be escaped in a query string.
Copy the result
Everything runs in your browser — safe for tokens and credentials.
Why use this base64 encode / decode
Runs on your device
Your input is handled entirely in this browser tab. Nothing is uploaded, so there is nothing for us to store, log or leak.
No sign-up, no quota
No account, no daily limit, no watermark and no email wall. Use it once or two hundred times a day.
Built to be linked
Options are stored in the URL, so a configured tool is a link you can send to a colleague or bookmark.
Technical notes
The browser's btoa() throws a DOMException on any character above U+00FF, which means most Base64 tools built on it fail on emoji, Bangla, Arabic and CJK. This one encodes to UTF-8 bytes before encoding, and decodes bytes back through TextDecoder, so every script round-trips exactly.
Round-trip behaviour by input type
| Input | Naive btoa() | This tool |
|---|---|---|
| hello | aGVsbG8= | aGVsbG8= |
| café | throws | Y2Fmw6k= |
| আমি | throws | 4KaG4Kau4Ka/ |
| 🌊 | throws | 8J+Vig== |
Supported
- Full Unicode via UTF-8, including emoji and combining marks
- Standard and URL-safe (RFC 4648 §5) alphabets
- Automatic padding repair on decode
- Whitespace and line breaks tolerated inside pasted Base64
- Direction auto-detection
Limits and trade-offs
- Text only. Encoding a file to a data URI is a separate tool.
- Base64 output is about 33% larger than the input — that is inherent to the format, not a limitation here.
- Auto-detection can guess wrong on short strings that are valid both ways. Set the direction explicitly if so.
Last verified August 2026 · benchmarks re-run each quarter.
Frequently asked questions
Why does Base64 break on emoji and non-English text?
Because the browser's built-in btoa() only accepts characters below U+0100 and throws on anything else. This tool encodes the text to UTF-8 bytes first, then Base64-encodes those bytes, which is the correct sequence and round-trips every script.
What is URL-safe Base64?
A variant defined in RFC 4648 §5 that replaces + with - and / with _, and usually omits the = padding. Standard Base64 breaks inside URLs because + means a space in a query string and / is a path separator. JWTs use the URL-safe variant.
Is Base64 encryption?
No, and this matters. Base64 is an encoding, not a cipher — anyone can reverse it in one step with no key. It exists to move binary data safely through text-only channels. Never use it to hide anything.
Why does my Base64 fail to decode?
Usually one of three things: a character outside the Base64 alphabet somewhere in the string, a length that is impossible for valid Base64, or the string was truncated in transit. This tool restores missing padding automatically, so that particular cause is already handled.
Is my data uploaded?
No. Encoding and decoding both run in this browser tab. People decode JWTs and API keys with these tools constantly, so a Base64 tool that uploaded its input would be an unusually bad idea.