Convert text into Unicode escape sequences and back. The \uXXXX format (JavaScript, JSON, Java) represents characters beyond the basic plane, such as emoji, with a surrogate pair; \u{…} (ES2015+) uses the code point directly, and U+XXXX is Unicode notation.
Unescaping validates surrogate pairs: a high surrogate without its low partner, or the other way round, is an error because it represents no character.
How to use it
- Choose Escape or Unescape.
- When escaping, pick the format and whether to convert only non-ASCII.
- Press Run.
Example
Señal: ¡listo! 😀 Se\u00F1al: \u00A1listo! \uD83D\uDE00 Limitations
- Other escapes such as \n or \x41 are not interpreted: only \uXXXX, \u{…} and U+XXXX (plus \\ for backslash).
- In U+XXXX format a space follows each escape to avoid ambiguity.
FAQ
- Why does 😀 become two escapes?
- In UTF-16, characters above U+FFFF take two code units (a surrogate pair): \uD83D\uDE00. With \u{1F600} it is a single escape.
- Why escape only non-ASCII?
- To make a source or JSON file safe for systems that mishandle UTF-8 without losing readability of the ASCII text.