Unicode escape converter
Runs entirely in your browser. Your files and data never leave your device.
About this tool
A Unicode escape converter turns plain text into escape sequences like \uXXXX, \u{XXXXX}, \xXX, or HTML numeric entities such as 😀, and back again.
Does it handle emoji and other characters outside the basic range?
Yes. It works through the input one full character (technically, one Unicode code point) at a time rather than one 16-bit unit at a time, so emoji and other characters outside the Basic Multilingual Plane come out correctly instead of getting split apart. For the \uXXXX format specifically, which can only represent 16-bit values, those wider characters are automatically split into a proper UTF-16 surrogate pair, the same encoding JavaScript strings use internally, so the escaped output round-trips back to the original character.
What are the escape and scope options for?
You can choose the escape format, and separately choose whether to escape only non-ASCII characters or escape everything, including plain letters and digits. Escaping only non-ASCII is usually what you want since it keeps the output readable; escaping everything is useful when you need to see the raw code point for every character, including ones that look ordinary. Going the other way, the converter reads a mix of formats in the same string, so text with é, ;, and \x41 side by side unescapes correctly in one pass rather than requiring you to pick one format up front.
What happens with malformed input?
Malformed sequences and unpaired surrogates get flagged with an error instead of being silently passed through or dropped. That includes a \u escape missing digits, a \u{...} escape with an unclosed brace, an HTML entity without its closing semicolon, and a stray high or low surrogate that isn’t paired with its match. Surfacing these as errors, rather than guessing, matters because a silently mangled escape can be hard to spot later and can corrupt data downstream.
Is the text I paste sent anywhere?
No, everything runs in your browser, so the text you convert never leaves your machine.
What is this useful for?
Use it to debug JSON payloads or JavaScript source that use \u escapes, decode HTML entities pasted from a scraped page, or check what a string of escaped Unicode from a log file or API response actually says. See MDN’s guide to string escape sequences and the Unicode Consortium for background on the character set itself.