Skip to content
Encoding2026-08-282 min read

Symptom: Chinese becomes a string of %XX

You copy https://example.com/search?q=中文 somewhere and the Chinese turns into https://example.com/search?q=%E4%B8%AD%E6%96%87. Rest assured: this is completely normal, not mojibake.

Why Chinese must be encoded into %XX

URL spec (RFC 3986) only allows a small set of ASCII characters directly in an address (letters, digits, and a few symbols). Chinese, spaces, and emoji are not on the whitelist. To fit any character into a URL, percent-encoding was invented:

  • Convert the character to UTF-8 bytes;
  • Write each byte as % + two hex digits.

So "中" in UTF-8 is three bytes E4 B8 AD, which becomes %E4%B8%AD.

| Original | UTF-8 bytes | Encoded | |---|---|---| | | E4 B8 AD | %E4%B8%AD | | space | 20 | %20 (or +) | | A | 41 | A (no encoding needed) |

How to decode it back

Reverse the operation: turn %XX back into bytes, then read as UTF-8. Open the URL Encode/Decode tool on ToolVault:

  1. Paste the %XX string into the input;
  2. Choose "decode" and get readable Chinese instantly;
  3. Conversely, choose "encode" to turn Chinese into a valid URL;
  4. Processed locally, never uploaded.

When not to encode (and caveats)

  • Path vs query: both /搜索 and ?q=搜索 can be encoded and both are safe; unencoded may be rejected by some servers.
  • Ambiguity of +: in query strings + is often treated as a space, so prefer %20 over + for spaces to avoid ambiguity.
  • Reserved chars: ? & = / # have syntactic meaning in URLs; encode them only when you mean the characters themselves.

FAQ

Why do some sites show Chinese directly while others show %XX?

Depends on whether the browser/server does a "display-layer" decode for you. Underneath, transmission is still encoded; the interface just restores it for viewing. Both are the same data presented differently.

Yes. The server decodes %E4%B8%AD back to "中" automatically, with no effect on the final access.

Is Base64 the same as URL encoding?

No. URL encoding percent-encodes bytes for URIs; Base64 turns arbitrary data into printable text (see Base64 tool). Different purposes.


Provided by ToolVault. Related tools: URL Encode/Decode, Base64 Encode/Decode, JWT Decoder. Visit the home page for more developer tools.


Advertisement