Where the two forms come from
Early JavaScript and Java wrote \uXXXX for a single 16-bit code unit, four hex digits covering 0 to FFFF. When Unicode grew to U+10FFFF, values beyond 16 bits were encoded in UTF-16 as a surrogate pair: a high surrogate in D800 to DBFF plus a low surrogate in DC00 to DFFF. That is why an emoji often appears as \uD83D\uDE00 in JSON or source code. The other form, \UXXXXXXXX, writes the code point directly in eight hex digits and shows up in Python and PHP contexts.
Steps
- Paste raw text such as café or an emoji on the escape side; paste a \uXXXX string on the other side to read it back.
- Choose the format: \uXXXX \UXXXXXXXX supports both.
- Enable keep printable ASCII to leave English, digits and common punctuation alone, so only Chinese and symbols are escaped.
- Click Escape or Unescape. Load example shows a demo and Clear resets.
Why surrogate pairs trip people up
A pair is two code units, so losing one yields half a character, which renders as a question mark or box. Counting \u sequences is the quick check: a Chinese character is one, a common emoji is two consecutive ones. Seeing a lone \uD83D with no low surrogate means truncation. Case is another snag: \u4E2D and \u4e2d are equivalent for most parsers, but some legacy systems accept lowercase only.
Pairing with other tools
When an API returns Chinese as \u strings, unescape here first to confirm the content, then decide whether the problem is encoding or escaping. Do not hand-build \u sequences when writing JSON; a serializer handles surrogate pairs and edge characters correctly. If unescaped output is still garbage, check for double escaping: a result that still begins with \u has another layer on top.