Skip to main content
NyankoTools

Unicode Escape / Unescape (\uXXXX to Text and Back)

Turn text into Unicode escapes such as \u3042, or decode escaped strings back into readable characters. Handy for reading JSON, JavaScript source, or logs full of sequences like "\u65e5\u672c\u8a9e". For HTML entities (& and <) use the HTML/JS String Escape tool, and for percent-encoding use the URL Encoder/Decoder.

🔒 Runs in your browser · Your data is never sent to a server

Notes

  • In "Escape → Text" mode, \uXXXX, \u{...}, \UXXXXXXXX, \xXX, U+XXXX and HTML numeric references (&#x...; / &#...;) are detected automatically, so no format needs to be chosen.
  • In JavaScript format, characters outside the BMP such as emoji become surrogate pairs like \uD83D\uDE00 (two \u escapes). ES6 format writes the same character as a single \u{1F600}.
  • A doubled backslash, as in "\\u3042", is treated as an escaped backslash and is not expanded.
  • Common sequences such as \n and \" are not handled here; use the HTML/JS String Escape tool for those.

Glossary

Unicode escape

A notation used in source code and JSON that writes a character as its code point in hexadecimal. \u3042 stands for "あ". It lets plain ASCII text represent any character regardless of the file encoding.

Surrogate pair

A pair of 16-bit values that UTF-16 uses to represent characters above U+FFFF, such as emoji and some rare kanji. In JavaScript, \uD83D\uDE00 is the pair that stands for "😀".

Code point

The number Unicode assigns to each character. It is written as "U+" followed by hex digits, for example U+3042 for "あ".

FAQ

Why is an emoji split into two escapes like \uD83D\uDE00?

A JavaScript \uXXXX escape holds a single 16-bit value, so characters above U+FFFF such as emoji are written as a high and low surrogate pair. Choose ES6 format (\u{1F600}) or Python format (\U0001F600) to get a single escape instead.

Are ASCII letters and digits escaped too?

By default letters, digits and symbols stay as they are, and only non-ASCII characters such as Japanese are converted. Set "Characters to convert" to "All characters" to escape everything, including line breaks.

How do I decode a string like "\u65e5\u672c\u8a9e"?

Switch the direction to "Escape → Text" and paste it. \uXXXX, \u{...}, U+XXXX, HTML numeric references and similar forms are detected automatically and turned back into characters.

Are \n and \" converted?

No. This tool only handles notations that stand for code points. For line-break and quote escapes, use the HTML/JS String Escape tool.

Share this page

↑↓ Select Enter Open Esc Close