How to use the converter
- Choose Escape or Unescape.
- Escape: paste readable text, pick the output format, and choose whether to escape only non-ASCII characters or every character.
- Unescape: paste text that contains escapes. The tool recognizes
\uXXXX,\u{X},\UXXXXXXXX,\xXX,&#xX;and&#N;, even when they are mixed. - Copy the result, or press Swap to run the conversion the other way.
What a Unicode escape is
Every character in Unicode has a number called its code point, written as U+ followed by hex digits: é is U+00E9, € is U+20AC and 😀 is U+1F600. An escape sequence writes that number in a form a programming language or file format understands, so the text survives systems that only handle ASCII.
The classic \uXXXX form comes from Java and JavaScript, and JSON uses the same syntax (RFC 8259, section 7). It has exactly four hex digits, which covers U+0000 to U+FFFF. Characters above U+FFFF are written as a UTF-16 surrogate pair: two escapes in a row. RFC 8259 gives the musical G clef, U+1D11E, as 𝄞.
Formats compared
| Format | é (U+00E9) | 😀 (U+1F600) | Used in |
|---|---|---|---|
\uXXXX |
é |
😀 |
JSON, JavaScript, Java, C# |
\u{X} |
\u{E9} |
\u{1F600} |
JavaScript (ES2015 and later) |
\uXXXX / \UXXXXXXXX |
é |
\U0001F600 |
Python string literals |
&#xX; |
é |
😀 |
HTML and XML (hex) |
&#N; |
é |
😀 |
HTML and XML (decimal) |
Examples
| Input | Escape (JS) | Notes |
|---|---|---|
café |
café |
Only the non-ASCII letter changes |
Привет |
Привет |
Six Cyrillic letters, six escapes |
€5 |
€5 |
Euro sign is U+20AC |
😀 |
😀 |
One emoji, two UTF-16 units |
Tab + tab + here |
Tab\u0009here |
Control characters are escaped too |
Code points vs bytes
An escape names a character, not its bytes. é is one code point, U+00E9, but two bytes in UTF-8 (C3 A9) and one 16-bit unit in UTF-16. 😀 is one code point, U+1F600, four bytes in UTF-8 and two units in UTF-16, which is why the \uXXXX form needs a pair. The optional character table in the tool shows all three views for each character, which helps when a system counts length in bytes or units rather than characters.
Common reasons to convert
- Reading API responses or logs that show
éinstead ofé. Unescape to see the real text. - Writing source code or config files that must stay ASCII. Escape the non-ASCII characters only.
- Fixing broken emoji. If a string shows
�after processing, one half of a surrogate pair was probably cut off. The tool warns when it finds a lone surrogate. - Comparing with HTML references.
éandéname the same character; the converter reads both.
Related encodings
A Unicode escape is not the same as URL encoding or a JSON-escaped string. URL encoding writes UTF-8 bytes, so é becomes %C3%A9; see HTML entities vs URL encoding for where each one belongs. To escape quotes, backslashes and line breaks for JSON, use the JSON escape tool. For Base64, hex and URL operations, use the universal encoder decoder.
All conversions run in your browser; the text you paste is not uploaded.
Frequently asked questions
Why does one emoji become two \u escapes?
The \uXXXX form holds only four hex digits, so it can express characters up to U+FFFF. Characters above that, such as most emoji, are written as a UTF-16 surrogate pair: U+1F600 becomes \uD83D\uDE00. The \u{1F600} form used in modern JavaScript needs only one escape.
Is \u00E9 the same as \u00e9?
Yes. Hex digits are case-insensitive in JavaScript, JSON and Python escapes. The tool writes uppercase by default and accepts both.
What is the difference between Unicode escapes and URL encoding?
A Unicode escape names a character by its code point, for example \u00E9 for é. URL encoding writes the character's UTF-8 bytes, so é becomes %C3%A9. Use the URL operations on the home page for that.