Unicode Escape / Unescape Online

Escape text to \uXXXX, \xXX, or \u{...} sequences and unescape them back, entirely in your browser.

Unicode Escape / Unescape runs entirely in your browser. The text you type or paste is never uploaded and stays on your device.

Open the HTML Entities Encoder / Decoder

About Unicode Escape / Unescape

Unicode Escape / Unescape converts text into \uXXXX, \xXX, or \u{...} escape sequences and decodes those sequences straight back into readable characters. Pick a format — JavaScript, JSON, CSS, or Python — and the tool builds the matching escape syntax for every non-ASCII character, from accented letters to emoji, including proper surrogate-pair handling for astral codepoints above U+FFFF. Toggle "Only non-ASCII" to leave plain ASCII text untouched, or escape everything for a fully sanitized string. Switch to Unescape to paste escaped text — mixed \uXXXX, \u{...}, \xXX, and \UXXXXXXXX sequences all decode correctly. Useful for debugging encoding issues, sanitizing strings in source code, or preparing JSON payloads. Everything runs locally — nothing is uploaded.

Features

How to use the Unicode Escape / Unescape

  1. Keep the Escape mode selected and pick a format: JS, JSON, CSS, or Python
  2. Type or paste the text you want to escape into the left pane
  3. Toggle "Only non-ASCII" on or off depending on whether plain characters should stay as-is
  4. Copy the escaped result, or switch to Unescape and paste escape sequences to decode them back

Example

Input

Héllo → ☃

Output

H\u00e9llo \u2192 \u2603

Non-ASCII characters become \uXXXX escapes; plain ASCII letters and spaces are left as-is.

Common errors & troubleshooting

Frequently asked questions

What does the Unicode Escape / Unescape tool actually convert?
It converts any text into \uXXXX, \xXX, \u{...}, or \UXXXXXXXX escape sequences (depending on the format you pick) and can decode those sequences back into the original characters.
Which escape formats does Unicode Escape / Unescape support?
JS (\uXXXX and \u{...} for astral characters), JSON (\uXXXX surrogate pairs), CSS (\XXXXXX), and Python (\uXXXX and \UXXXXXXXX for astral characters).
How does Unicode Escape / Unescape handle emoji and other characters above U+FFFF?
It correctly detects astral codepoints and represents them using the target format's own syntax — a single \u{...} escape in JS, a surrogate pair of two \uXXXX escapes in JSON, or \UXXXXXXXX in Python.
What does the "Only non-ASCII" toggle do in Unicode Escape / Unescape?
When it is on (the default), plain ASCII characters such as letters, digits, spaces, and common punctuation are left exactly as typed, and only non-ASCII characters are escaped. Turn it off to escape every character.
Can Unicode Escape / Unescape decode mixed escape styles in one string?
Yes. The Unescape mode recognizes \uXXXX, \u{...}, \xXX, \UXXXXXXXX, and CSS \XXXXXX sequences and decodes any combination of them found in the pasted text.
Does Unicode Escape / Unescape upload the text I paste?
No. All escaping and decoding happens locally in your browser. Nothing you type or paste is sent anywhere.

Related tools

All ArrayKit tools