Base64 Encode Online: Text to Base64 (UTF-8 / Chinese Safe)

2026-08-11

Why Base64-encode text

When a channel only accepts printable ASCII—JSON strings, headers, config files, email bodies—Base64 is the usual wrapper. Raw btoa fails on non-Latin text; you must encode UTF-8 first.

ComTools Base64 Encode (Tools/Developer/Base64Encode) runs locally: encodeURIComponent → bytes → standard Base64. Unicode works.

Example

Input:

Hello, 世界

Output sketch:

SGVsbG8sIOS4lueVjA==

Trailing = / == is padding—do not strip it unless you know the decoder allows it.

Steps

  1. Open Base64 Encode.
  2. Paste plain text on the left.
  3. Click Run and copy the right pane.

Nothing is uploaded.

vs nearby tools

Tool Use when
Base64 Encode Plain text → standard Base64
Base64 Decode Base64 → text
JSON Base64 JSON payloads, optional URL-safe
Image Base64 Images ↔ Data URLs

This page emits the standard alphabet (+ /), not URL-safe (- _).

Common scenarios

Scenario Tip
Embed notes / sample tokens in config Encode, then paste
API field must stay ASCII Encode before JSON
Someone sent you Base64 Use decode
Ship a whole JSON as one string Minify first, then encode

Notes

  • Empty input → empty output.
  • Output is ~4/3 the input size.
  • Base64 is not encryption—anyone can decode it.

FAQ

Will Chinese mojibake?
This tool encodes UTF-8; decode with UTF-8 (the site’s decode tool does).

Can I put + / in a URL?
Not safely. Use JSON Base64 for URL-safe, or map + /- _ and drop =.

Same as image Data URLs?
No. Text Base64 has no data:image/...;base64, prefix—use the image tool for pictures.


中文版