Turn characters into escape sequences for JavaScript, ES6, CSS, Python, Java or C, which is useful when source files or config formats must stay pure ASCII.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Characters as escape sequences
A Unicode escape writes a character as its code point in a form that survives any transport: \u00e9 rather than a literal é. That matters where a file might be read as the wrong encoding, or where a toolchain mangles anything above ASCII.
Worked example
"é" → \u00e9
"😀" → \ud83d\ude00 (surrogate pair, JavaScript form)
→ \u{1F600} (ES6 code point form)Why emoji produce two escapes
JavaScript strings are UTF-16, so any character above U+FFFF is stored as a surrogate pair — two units that mean one character. The older \uXXXX form can only express one unit, so it needs both. The braced form expresses the code point directly and is clearer where it is supported.
Where escapes are needed
JSON payloads passing through systems with uncertain encoding handling, source files that must stay pure ASCII, configuration formats with no encoding declaration, and test fixtures where you want the intent to be visible in the source.
Limits
Escaping increases size roughly sixfold per non-ASCII character and makes text unreadable to humans, so it is a transport measure rather than a storage format. Conversion is local to your browser.
How to use the Unicode Escape
- Paste text containing accented letters, non-Latin scripts or emoji.
- Choose the escape style for your target language – JavaScript, ES6, CSS, Python, Java or C.
- Choose whether to escape only non-ASCII characters or every character.
- Click "Escape Unicode".
Frequently asked questions
Why does an emoji become two escapes in JavaScript style?
Because the classic four-digit form can only address the first 65536 code points. Anything above that must be written as a UTF-16 surrogate pair – two escapes for one character. The ES6 brace form and Python capital-U form express it as a single escape instead.
Which style should I pick?
Match your target: the brace form for modern JavaScript, the four-digit form for Java and older JavaScript, the backslash-hex form for CSS where a trailing space terminates the escape, and the capital-U form for Python when the character is above the basic plane.
Why escape at all if my files are UTF-8?
Usually you should not – readable text is better. Escaping earns its keep when a build pipeline, a legacy system or a configuration format cannot be trusted to preserve encoding, or when you need to make an invisible character explicit in source code.