Base64 Encode / Decode
Encode text or binary to Base64 and decode it back — with full UTF-8 support.
About this tool
Base64 encoding converts binary data — or any text — into an ASCII string that is safe to transmit through systems that handle only text, such as email SMTP, HTML data URIs, HTTP Basic Auth headers, and JSON payloads. This tool encodes any text input to Base64 and decodes any Base64 string back to the original text, with full UTF-8 support for non-ASCII characters.
A common pitfall with Base64 in JavaScript is that the built-in btoa() function does not handle Unicode strings above code point 127 — it throws "invalid character" errors. This tool uses a proper UTF-8 encode/decode pipeline so you can safely round-trip emoji, Chinese characters, Arabic text, and any other Unicode content.
Everything runs in your browser with zero network requests. The tool shows the raw Base64 string, the byte length of both the original and encoded forms, and validity feedback when a decode input contains invalid characters. Use Swap to toggle between encode and decode mode, Copy to grab the output, and Paste Sample to see an example.
Frequently asked questions
Does Base64 encrypt my data?
Why is Base64 output always longer than the input?
What is URL-safe Base64?
Why do I get "invalid character" errors when decoding?
Related tools
URL Encode / Decode
Encode and decode URL components and full URLs with percent-encoding, instantly.
HTML Entity Encode / Decode
Encode special characters as HTML entities and decode them back — all in your browser.
Hex ↔ Text Converter
Convert text to hexadecimal bytes and decode hex back to text — with full UTF-8 support.