Unicode Escape Encoder / Decoder

Convert characters to and from \uXXXX escapes, with correct surrogate pairs for emoji and other supplementary-plane characters, plus code point, UTF-8 and UTF-16 detail per character.

Result\u4F60\u597D\u002C\u0020\uD83D\uDE00\u0020\u0041
Per-character detail
CharacterCode pointUTF-8 bytesUTF-16 units
你U+4F600xE4 0xBD 0xA0U+4F60
好U+597D0xE5 0xA5 0xBDU+597D
,U+002C0x2CU+002C
U+00200x20U+0020
😀U+1F6000xF0 0x9F 0x98 0x80U+D83D
U+00200x20U+0020
AU+00410x41U+0041

What is it

Every character lives at a numbered code point: A is U+0041, 中 is U+4E2D. JavaScript writes these as \uXXXX escapes. The twist: emoji and rare characters live beyond the first 65536 slots, so one emoji is not one \uXXXX — it is a pair of them called a surrogate pair, e.g. the smiley face becomes \uD83D\uDE00. This tool encodes both planes correctly and shows each character’s code point, UTF-8 bytes and UTF-16 code units.

Notes & fun facts

Why on earth does a smiley take two escapes? Because the system was designed when 65536 slots felt infinite, and emoji arrived decades later. Engineers then had to bolt on a clever trick: reserve the range D800–DFFF. A high surrogate followed by a low surrogate means one big character. It is a patch that worked so well nobody dares remove it now.

Origin & history

The Unicode Consortium published the first Unicode Standard in October 1991. Version 2.0 (July 1996) bumped the limit to over a million code points and introduced UTF-16 with surrogate pairs, led by engineers including Peter Hartke and the Unicode Technical Committee — that is why emoji today always show up as two escapes.

Keep a kind heart, hold integrity as your foundation, and cherish warm love; may the world know peace and humanity live in harmony.
持善良之心,守正直之本,怀温暖之爱;愿世界和平,人间祥和。