Unicode Escape
Convert text to \uXXXX, \u{…}, &#x…;, U+XXXX and other escapes or back, with each character’s code point and UTF-8 bytes.
0 characters · 1 line
0 characters · 1 line
Shortcut: Ctrl/⌘ + Enter uses the result as input and switches mode
Code points
Enter some text to list the code point and encodings of each character.
How to use
- Choose “Escape” to turn text into escape sequences, or “Unescape” to turn escapes back into text.
- When escaping, pick a format (JavaScript, ES6, Python, CSS, HTML or U+) and whether to escape only non-ASCII characters or everything.
- When unescaping, Auto recognizes \uXXXX, \u{…}, \UXXXXXXXX, \xXX, &#x…;, &#…; and U+XXXX together. Switch to CSS mode for CSS escapes.
- The “Code points” table lists each character’s code point, UTF-8 bytes, UTF-16 units and Unicode category.
- Click “Copy” to grab the result, or “Use result as input” to convert it back and check that it matches.
FAQ
Is my data uploaded?
No. Every conversion happens in your browser, and your data never leaves your device.
Why does one emoji become two \u escapes?
JavaScript, JSON and Java strings use UTF-16, and \uXXXX only reaches U+FFFF. Characters beyond that, such as emoji, are split into a surrogate pair: 👍 (U+1F44D) becomes \uD83D\uDC4D. ES6 \u{1F44D} and Python \U0001F44D write the full code point instead.
Where is each format used?
\uXXXX is for JavaScript, JSON, Java and C#; \u{…} for JavaScript since ES2015; \U for Python and C; \XXXX for CSS content values and selectors; &#x…; and &#…; for HTML and XML. U+XXXX is the Unicode standard’s notation, common in documentation.
Why do CSS escapes sometimes end with a space?
A CSS escape is a backslash and 1–6 hex digits, ending at the first character that is not a hex digit. When the next character happens to be 0–9 or a–f, a space separates them. CSS swallows that space, so it never shows up on the page.
Why does one visible character take several rows in the table?
Some characters are made of several code points: 👍🏽 is 👍 plus a skin tone modifier, é can be e plus a combining accent, and family emoji join people with a zero-width joiner (U+200D). The table lists every code point, which also helps you spot invisible characters.
Related tools
HTML Entities
Escape < > & and other characters as HTML entities or decode them back. Supports all 2,125 named and numeric references, with a quick reference.Text to Hex
Convert text to UTF-8 bytes in hex or decode hex back to text, with strict UTF-8 validation that points at the bad byte.String Escape
Escape and unescape text for JSON, JavaScript, HTML, XML, CSV, SQL, shell and regex string literals, with error positions.