Base64 Encode/Decode

Encode and decode Base64 online with full UTF-8 and Unicode support for Chinese, emoji and more. Swap results to verify instantly — all processed locally, nothing is uploaded.

Choose a mode

How to use

  1. Pick a mode at the top: "Encode" turns text into Base64; switch to "Decode" to turn Base64 back into readable text.
  2. Paste or type your content into the box — encode mode accepts any UTF-8 text, including Chinese, Japanese and emoji.
  3. Click the "Encode / Decode" button and the result appears below; use the "Copy" button in the top-right corner to grab it.
  4. To check a result, click "Swap" to move the output back into the input while switching modes automatically, then run it again in reverse.
  5. "Example" fills in a demo value for the current mode; "Clear" resets the input, result and any error message.

FAQ

Why does Chinese text stay intact?
This tool first converts text to UTF-8 bytes with TextEncoder and then to Base64; decoding restores UTF-8 the same way. Mojibake only happens when UTF-8 data is wrongly treated as Latin-1, which is what a bare btoa call does.
What does "not a valid Base64 string" mean?
Standard Base64 may only contain letters, digits, +, / and up to two trailing = characters, and its total length must be a multiple of 4. Check for missing characters, stray symbols or a truncated paste.
Decoding reports that the result is not valid UTF-8?
It means the decoded bytes are not plain text — for example an image or an archive. Binary data needs a dedicated binary-to-Base64 tool; this page targets text content.
Is my content sent to a server?
No. Encoding and decoding both run locally in your browser, so your input never leaves your device.

Related Tools