← HashitoSystem Home 日本語 Tools Blog
Input & settings
Result

About Unicode escapes

What is the \uXXXX format?

It writes one character as a backslash, u, and four hexadecimal digits. For example the letter A is \u0041 and the hiragana あ is \u3042. It is the standard notation understood by JavaScript, JSON, Java and C-family string literals, useful when source code cannot hold multibyte characters directly or when you want to avoid editor and terminal mojibake. By default this tool escapes only characters outside ASCII (code point 128 and above) and leaves letters, digits and symbols as they are.

Which forms does unescape accept?

It restores both \uXXXX (fixed four digits) and the ES6 \u{XXXXX} braced form (variable length). The former correctly recombines surrogate pairs (two units for one supplementary character) into a single character. Any text that is not an escape sequence is passed through unchanged.

How is this different from JSON escape or URL encode?

This tool only swaps characters to and from \uXXXX. It does not turn newlines or double quotes into \n and \" (JSON string escaping), nor bytes into %XX (URL encoding). Use the related tools for those jobs.

Frequently asked questions (FAQ)

What is the \uXXXX format?

It is the notation used in JavaScript, JSON, Java and C-family string literals where one character is written as a backslash, u, and four hexadecimal digits. For example the letter A is \u0041. It is used when you cannot or do not want to put multibyte characters directly in source code, or to avoid mojibake.

Is my input sent to a server?

No. Escaping, unescaping and downloading all run entirely in your browser. Your input is never sent to any server.

Does it handle surrogate pairs such as emoji?

Yes. JavaScript strings are UTF-16, so supplementary characters (such as emoji) are split into a high and low surrogate and written as two \uXXXX units, for example \uD83D\uDE00. When unescaping, the braced \u{1F600} form is also supported.