Unicode Escape
Escape and unescape Unicode characters
About Unicode Escape
Replaces every character outside ASCII with a \uXXXX escape and turns \uXXXX sequences back into readable text. Emoji and other characters above U+FFFF are written as UTF-16 surrogate pairs, the form JSON and JavaScript strings use, while plain ASCII passes through untouched. Handy for Java .properties files, ASCII-only JSON or making sense of escaped strings in logs.
Category: Encoding.
Frequently asked questions
What is a Unicode escape sequence?
▾
A way to represent any Unicode character using ASCII text: \u followed by four hex digits, so \u0041 represents A (U+0041). To escape code points above U+FFFF, JSON needs a surrogate pair such as \ud83d\ude00, while JavaScript since ES2015 also accepts \u{1F600}.
When do I need to escape Unicode?
▾
When your target format or transport only supports ASCII (some JSON parsers, source files with restricted encoding, config formats). Most modern systems handle Unicode directly and don't require escaping.
Which characters get escaped, and how are emoji handled?
▾
Every character above U+007F is escaped using lowercase hex digits, while ASCII letters, digits, punctuation and line breaks are left as they are. Emoji and other characters beyond U+FFFF become two escapes (a surrogate pair), and unescaping joins them back into the original character.
What is the difference between \u and \x escapes?
▾
\uXXXX is the standard 4-hex-digit Unicode escape (U+0000 to U+FFFF). \xXX is a 2-hex-digit Latin-1 escape (0x00 to 0xFF) that JavaScript accepts but JSON doesn't. This tool only writes and reads \uXXXX, so \x, \u{...} and escapes such as \n are left untouched.