🔣 Base64 Encode & Decode
A free online Base64 encode & decode tool: convert between text and Base64 in one click. Under the hood it uses the browser's native TextEncoder / TextDecoder to process text as UTF-8, so Chinese, Japanese, and Emoji all encode and decode correctly — no more garbled CJK text like you'd get from naive approaches. It also shows the input's UTF-8 byte count, handy for estimating API payload sizes. Every conversion runs locally in your browser, so nothing is ever uploaded to any server. Even sensitive text you need to encode is safe to use here — no sign-up needed.
Current input: 0 bytes (UTF-8)
How to Use
- Choose a mode: “Encode” turns plain text into Base64, “Decode” turns a Base64 string back into text.
- Paste or type your content in the input box (encode mode accepts text in any language; decode mode needs a valid Base64 string).
- Click “Convert”. The result appears in the read-only output box below, along with the input text's UTF-8 byte count.
- Click “Copy” to copy the result in one click, or “Clear” to start over.
Why does non-English text so often break in Base64?
The browser's built-in btoa / atob only understand Latin-1 (single-byte) characters — pass Chinese or Japanese text straight into btoa and you'll get an error or garbled output. Many basic online tools never handle this, so CJK text breaks the moment it's encoded. This tool first converts text to a byte array with TextEncoder using UTF-8, then encodes it to Base64; decoding reverses the process with TextDecoder, so Chinese, Japanese, Korean, and Emoji never break — the only correct way to handle multilingual text.
About the byte count: a Chinese or Japanese character usually takes 3 bytes in UTF-8, an Emoji takes 4. A quick glance at the byte count before encoding tells you roughly how long the resulting Base64 string will be (Base64 output is about 4/3 the size of the original bytes) — useful when assembling API parameters or writing config files.