🔣 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

  1. Choose a mode: “Encode” turns plain text into Base64, “Decode” turns a Base64 string back into text.
  2. Paste or type your content in the input box (encode mode accepts text in any language; decode mode needs a valid Base64 string).
  3. Click “Convert”. The result appears in the read-only output box below, along with the input text's UTF-8 byte count.
  4. 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.

FAQ

The decoder says “not valid Base64” — what should I do?
Check three things: did you copy the whole string (Base64 often ends with 1–2 = padding characters)? Are there stray characters beyond normal whitespace (the tool ignores ordinary whitespace automatically)? Did copying from a webpage bring in invisible characters? Copy the complete Base64 string again and retry.
Will Chinese text break when encoded?
No. This tool processes text as UTF-8 before converting to Base64, so Chinese, Japanese, and Emoji all decode back correctly — the biggest difference from crude tools that call btoa directly.
Does Base64 encoding make content bigger?
Yes — Base64 uses 4 characters to represent 3 bytes, so encoded output is about 133% of the original size. It's great for squeezing binary data or special text into JSON, URLs, or config files that only accept plain text, but not for “compressing” data.
Will my text be uploaded?
No. Encoding and decoding happen entirely in your browser — nothing ever leaves your device.

Related Tools

📄 SyncPage — real-time document collaboration Review PDFs, slides, Word & Excel files together — present live, annotate in real time, talk by voice. Guests join free from an invite link. Try SyncPage →