Encode / Decode

Unicode Escape / Unescape

?

About Unicode escaping

What is a Unicode escape sequence?
A way to represent a character by its numeric code point instead of the character itself, e.g. \u00e9 for é. It lets non-ASCII text be written using only plain ASCII characters — useful in source code, JSON, and other formats that need to stay ASCII-safe.
What's the difference between \uXXXX and \u{XXXXX}?
\uXXXX is the original JavaScript syntax: exactly four hex digits representing one UTF-16 code unit. Characters outside the Basic Multilingual Plane (emoji, some CJK) don't fit in four digits, so JavaScript splits them into a surrogate pair — two \uXXXX escapes in a row. The newer \u{XXXXX} syntax (ES2015+) takes a variable number of hex digits and represents a full code point in a single escape.
Why do some emoji turn into two escapes instead of one?
Emoji and other characters above U+FFFF need more than 16 bits, so in UTF-16-based JavaScript strings they're stored as a pair of 16-bit "surrogate" code units. With the default surrogate-pair option, encoding one of these characters produces two \uXXXX escapes rather than one.
Is \u{XXXXX} syntax safe to use everywhere?
It's valid in JavaScript string literals (ES2015+) and regular expressions with the /u flag, but JSON only supports the classic \uXXXX form — if the output is going into a JSON string, leave "Code point escapes" off.
Does this tool upload my data anywhere?
No. Encoding and decoding happen entirely in your browser using standard Web APIs. Nothing you type or paste ever leaves your device.

Configuration options

Escape all characters
Escapes every character, including printable ASCII, instead of only the ones outside the ASCII range. Leave off to keep readable text as-is and only escape what actually needs it.
Code point escapes (\u{...})
Uses the ES2015 \u{XXXXX} syntax for characters above U+FFFF instead of splitting them into a two-escape surrogate pair. Not valid inside JSON strings.

Convert text to and from \\uXXXX Unicode escape sequences.

input chars
0
output chars
0
status
idle