Skip to content
Devtoolry

Unicode Escape / Unescape

Convert text to \uXXXX Unicode escape sequences and back online, including emoji and astral characters. Handy for JavaScript, JSON and Java strings.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the Unicode Escape / Unescape

Unicode escapes like \u00e9 let you write any character in ASCII-only source code, JSON and config files. This tool converts text to escape sequences and back, including emoji outside the Basic Multilingual Plane.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the Unicode Escape / Unescape

  1. Choose Escape or Unescape.
  2. Paste the text.
  3. Optionally escape plain ASCII too, then copy the result.

Example

Escape accents, symbols and emoji

Input

Café ☕ 😀

Result

Caf\u00e9 \u2615 \ud83d\ude00

ASCII letters stay as they are. é and ☕ become one escape each; the emoji, above U+FFFF, becomes a surrogate pair.

Common mistakes

  • Escapes in Python and other languages. Python 3 writes characters above U+FFFF as \U0001F600, not a surrogate pair. The \uXXXX pairs here suit JavaScript, JSON and Java.
  • Double backslashes. Text copied from a JSON string may contain \\u00e9 (an escaped backslash). Unescape it once more, or remove one backslash first.
  • Invisible characters. Zero-width spaces, non-breaking spaces and byte order marks look like nothing but break comparisons. Escaping makes them visible as \u200b, \u00a0 or \ufeff.

Works well with the Unicode Escape / Unescape

Frequently asked questions

How are emoji escaped?

Characters above U+FFFF, such as most emoji, become a surrogate pair of two \uXXXX escapes, as JavaScript and JSON require.

When do I need escapes?

When a file or system only accepts ASCII, or to make invisible characters visible while debugging.

What is a surrogate pair?

JavaScript strings use UTF-16, where characters above U+FFFF are stored as two 16-bit units. 😀 (U+1F600) becomes \ud83d\ude00.

Does it support \u{1F600} syntax?

Unescaping accepts both \u{1F600} and \uXXXX escapes, including surrogate pairs. Escaping always writes the four-digit form, because JSON and Java do not understand \u{…}.

Guides and tutorials