Base64 Encoder / Decoder

Encode any text to Base64 or decode Base64 strings back to readable text. Supports all Unicode characters including Chinese, Japanese, and emoji.

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used for:

  • Embedding images directly in HTML or CSS (data URIs)
  • Encoding email attachments (MIME)
  • Storing binary data in JSON or XML
  • Basic authentication headers in HTTP requests

The name comes from the 64-character alphabet used: A-Z, a-z, 0-9, +, and /. Padding with = signs ensures the output length is always a multiple of 4.

How This Tool Works

Our encoder uses the modern TextEncoder API to properly handle UTF-8 characters, avoiding the legacy issues with special characters that older Base64 tools suffer from.

The decoder uses TextDecoder to accurately reconstruct the original text, ensuring Chinese characters, emojis, and other Unicode content are preserved.

Examples

Example 1 — Simple text.

Input:  Hello, Toolbox!
Output: SGVsbG8sIFRvb2xib3gh

Example 2 — Chinese characters. UTF-8 support means non-ASCII text works correctly:

Input:  你好,世界
Output: 5L2g5aW977yM5LiW55WM

Example 3 — Emoji. Emoji are multi-byte in UTF-8 and still encode cleanly:

Input:  👋
Output: 8J+Riw==
Base64 Encode/Decode Tool
Base64 encoding and decoding tool, supports Chinese characters
Frequently Asked Questions

Why does my Chinese text get garbled on other sites?

Many legacy tools encode each character as a single byte using the Latin-1 charset, which corrupts Chinese, Japanese, Korean, and emoji. This tool uses proper UTF-8 encoding, so Unicode text round-trips correctly.

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode a Base64 string, so never use it to protect sensitive data. It exists to make binary data safe to transmit over text-only channels.

What about URL-safe Base64?

Standard Base64 uses + and /, which have special meaning in URLs. URL-safe Base64 replaces them with - and _. This tool outputs standard Base64; replace those two characters if you need the URL-safe variant.

Why does my decoded output contain strange symbols?

It usually means the input was not valid Base64 to begin with, or it encoded binary data (like an image) rather than text. This tool interprets the decoded bytes as UTF-8 text.

Can I encode files or images?

Not directly — this tool works on text. For images, tools usually read the file as bytes first. The same Base64 principles apply once the bytes are converted to a string.

Common Mistakes
  • Pasting Base64 that contains newlines (common when copying certificates or keys) — whitespace is usually fine but stray characters will break decoding.
  • Adding spaces into the encoded string — Base64 has no spaces, so keep the output intact.
  • Expecting + and /to survive a URL unmodified — use URL-safe variants when embedding in URLs.
  • Assuming Base64 provides security — it does not.