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.
| Character | Code point | UTF-8 bytes | UTF-16 units |
|---|---|---|---|
| 你 | U+4F60 | 0xE4 0xBD 0xA0 | U+4F60 |
| 好 | U+597D | 0xE5 0xA5 0xBD | U+597D |
| , | U+002C | 0x2C | U+002C |
| U+0020 | 0x20 | U+0020 | |
| 😀 | U+1F600 | 0xF0 0x9F 0x98 0x80 | U+D83D |
| U+0020 | 0x20 | U+0020 | |
| A | U+0041 | 0x41 | U+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.
