Unicode Escape & Unescape (\u, UTF-8)
Developer ToolsTurn text into \uXXXX and other escape notations and back, and see each character's code point and UTF-8 bytes.
Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy
About
What the Unicode Escape & Unescape does
Unicode Escape & Unescape writes text as escape sequences and reads them back, updating as you type. Notations include \uXXXX for JavaScript, JSON and Java, \u{1F600} for modern JavaScript, \U0001F600 for Python and C, U+ code points, HTML hex entities and raw UTF-8 bytes. Unescape understands all of them in one pass, and a table lists every character's code point, UTF-8 bytes and UTF-16 units.
Steps
How to use it
- 1Choose Escape or Unescape.
- 2Pick a notation, and whether to escape only non-ASCII characters.
- 3Copy the result and check the character table below it.
Example
A real run
Input
Café 😀
Output
js Caf\u00E9 \uD83D\uDE00
es6 Caf\u{E9} \u{1F600}
python Caf\xE9 \U0001F600
html Café 😀
utf8 Caf\xC3\xA9 \xF0\x9F\x98\x80
U+ U+0043 U+0061 U+0066 U+00E9 U+0020 U+1F600The é is one code point (U+00E9) and two UTF-8 bytes; the emoji is one code point (U+1F600), two UTF-16 units and four UTF-8 bytes, which is why the notations differ.
Options
Every setting, and when to use it
- Notation
- \uXXXX writes emoji as two surrogate escapes (\uD83D\uDE00), as JavaScript and JSON require. \u{…} and \U00… write each emoji as one escape. UTF-8 bytes (\xF0\x9F…) is how C and Python byte strings show text.
- Only non-ASCII characters
- Leaves plain letters, digits and punctuation readable and escapes the rest, which is what you usually want in source code and config files.
- Unescape
- Reads any mix of \u, \u{…}, \U, \x byte runs, &#x…; and U+ notations, so text copied from logs, JSON or source code comes back as plain characters.
Good to know
Common problems and limits
Up to 1 MB. The character table lists the first 300 characters.
Character names (such as GRINNING FACE) are not shown; the code point identifies each character exactly.
For JSON strings use JSON Escape, which also handles quotes and line breaks; for HTML use the HTML Entity Encoder; to change a character's style, use the Unicode Text Converter.
Audience
Who uses it
- DevelopersPut accented text or emoji into source code, resource files or JSON that must stay ASCII, and read escaped strings from logs.
- Localization engineersCheck exactly which code points a translated string contains, including invisible ones.
- Data engineersDiagnose encoding bugs by comparing a string's UTF-8 bytes with what a system actually received.
FAQ
Frequently asked
What is \u0000?
An escape for the character with code point 0, the null character. In general \u followed by four hex digits is the character with that code point, so \u00E9 is é. JavaScript, JSON, Java and C# all use this form.
What are surrogate pairs?
UTF-16, used by JavaScript and Java, stores characters above U+FFFF, such as most emoji, as two 16-bit units. 😀 (U+1F600) becomes \uD83D\uDE00. Notations such as \u{1F600} and \U0001F600 write the code point directly instead.
How do I fix Python's unicodeescape error with Windows paths?
In a normal Python string, "C:\Users" starts a \U escape and fails with a unicodeescape error. Use a raw string, r"C:\Users\me", double the backslashes, or use forward slashes, which Windows accepts.
What is the difference between UTF-8 and UTF-16?
Both encode every Unicode character. UTF-8 uses 1 byte for ASCII and up to 4 for other characters, and dominates on the web and in files. UTF-16 uses 2 or 4 bytes and is used inside JavaScript, Java and Windows. The table shows a character in both.
Why does an emoji become two \u escapes?
Because \uXXXX can only express four hex digits, and emoji have code points above FFFF. JavaScript and JSON therefore write them as a surrogate pair. Choose the \u{…} notation for one escape per emoji.
Is my text sent anywhere?
No. Escaping and unescaping happen in your browser. A copy of each run is saved to your past runs so you can reopen it.
Automation: an MCP tool unicode_escape(text, notation), unicode_unescape(text) and an n8n node are planned for this tool.