Skip to content
Categories
Unicode Escape / Unescape
Escape and unescape non-ASCII characters using \uXXXX notation.
Overview
- Converts non-ASCII characters, such as Japanese text or emoji, into \uXXXX escape sequences as used in JavaScript string literals (escape), or restores them back to the original characters (unescape).
- ASCII characters with a code point below 0x80 (letters, digits, basic symbols) are left as-is; only other characters are converted.
- Characters that need a UTF-16 surrogate pair, such as emoji, are correctly split into and recombined from two \uXXXX sequences.
Usage
- Enter the text you want to escape, or the \uXXXX-encoded string you want to unescape, into the text area.
- Click the "Escape" or "Unescape" button.
- The result is displayed below.
Example
Input
Helloไธ็
Output
Hello\u4e16\u754c
Use Cases
- Converting non-ASCII characters into escape sequences for embedding in JSON or JavaScript source code
- Decoding a \uXXXX-formatted string output by another system or log to check the original Japanese text or emoji
- Checking a specific character's Unicode code point for learning or reference purposes
FAQ
Are ASCII characters (letters, digits, etc.) also escaped?
No. Characters with a code point below 0x80 are left as-is; only other characters are converted to \uXXXX notation.
What happens to characters that need a surrogate pair, like emoji?
Following JavaScript's internal UTF-16 representation, they are split into two \uXXXX sequences. Unescaping recombines them correctly.
Is the text I enter sent anywhere?
No. All escaping and unescaping happens entirely in your browser.
Notes
- ASCII characters (code point below 0x80) are not escaped. Only non-ASCII characters, such as Japanese text or emoji, are converted to \uXXXX notation.
- A character requiring a surrogate pair, such as an emoji, is split into two \uXXXX sequences. Taking only one of them will not decode correctly.
- The entered text exists only on the page and is lost on reload.
Related Tools
Escape and unescape text for use in HTML.
Encode and decode text to and from URL encoding.
Break a URL down into its individual components.