Unicode Escape & Unescape — \uXXXX, \u{…}, HTML Entities
Convert text to Unicode escape sequences and back. Output as
\uXXXX, \u{…} or HTML entities — and paste any of them mixed together to
decode. Surrogate pairs (emoji) handled correctly. Runs entirely in your browser.
Edit either box. Decoding auto-detects \uXXXX,
\u{…}, \xXX and &#…; entities, even mixed together.
What a Unicode escape is
Every character has a code point — a number Unicode assigns it. A
is U+0041, é is U+00E9, 世 is U+4E16, the rocket 🚀 is
U+1F680. A Unicode escape writes that number in a form a programming language or
markup can read: é in JavaScript or JSON, \u{1f680} in ES6,
🚀 in HTML. The visible character and its escape are two spellings of the
exact same thing.
Why you'd escape text
- Safe transport. A JSON or source file that must stay pure ASCII can
carry any character as
\uXXXXwithout corruption through old tools or email. - Seeing the invisible. Escaping reveals look-alike spaces, zero-width characters and combining marks that are impossible to spot by eye.
- Debugging encoding bugs. When text arrives as
café, the escapes tell you exactly which bytes/code points you actually received.
Gotchas worth knowing
- \uXXXX only holds 4 hex digits — that's the catch. It maxes out at
U+FFFF. Characters above that (emoji, rare CJK) need a surrogate pair: 🚀 is
🚀, two escapes for one character. The\u{…}form avoids this by allowing the full code point. This tool emits valid surrogate pairs for\uXXXXautomatically. - Escape is not encryption. It's a fully reversible, public representation — never use it to hide anything.
- Case and leading zeros.
éandéare the same; the 4-digit form must keep its leading zeros, the\u{…}form doesn't. - "Only escape non-ASCII" keeps it readable. Leaving plain ASCII intact
means
cafébecomescafé, not a wall of escapes.
Frequently asked questions
How do I unescape \uXXXX to text?
Paste the escaped string into the Escaped box; the decoded text appears instantly. It accepts
\uXXXX, \u{…}, \xXX and HTML &#…; entities,
even several formats mixed in one string.
Why is one emoji two \u escapes?
Because \uXXXX can only encode values up to U+FFFF. Emoji live above that range,
so they're stored as a surrogate pair — two 16-bit halves that together form one character.
What's the difference between \uXXXX and \u{…}?
\uXXXX is fixed at four hex digits (JavaScript/JSON classic). \u{…}
(ES6) takes a variable-length code point, so a single escape covers any character including emoji.
Need other text utilities? Browse all tools on the home page.