Unicode Escape and Unescape
Put accented letters, symbols and emoji into source code, JSON or CSS safely, as escape sequences that survive any file encoding. Or read a string full of \u escapes as the text it stands for.
How to escape Unicode characters
- 1Paste your text.
- 2Pick the style your language uses, and whether to escape plain ASCII too.
- 3Copy the escaped text, or switch to Unescape to go back.
Styles
JavaScript, JSON and Java write \u00E9 and split emoji into two escapes (a surrogate pair); modern JavaScript can write \u{1F600}; Python and C use \U0001F600 for characters beyond four digits; CSS writes \E9 and HTML é.
Unescaping
Unescape reads \uXXXX (pairs included), \u{…}, \UXXXXXXXX, \xXX and HTML codes like é and é in any mix. CSS escapes aren't read back, since they're hard to tell apart from ordinary text.
Plain text stays readable
By default only characters outside printable ASCII are escaped, and line breaks and tabs are left alone.
Frequently asked questions
- Is my data uploaded?
- No. The conversion runs in your browser and nothing is sent anywhere.
- Why does one emoji become two \u escapes?
- JavaScript and JSON strings use UTF-16, where characters beyond U+FFFF are stored as two units. Both escapes together make one emoji.
- How is this different from URL encoding?
- URL encoding writes UTF-8 bytes as %XX for web addresses; Unicode escapes write code points for source code.