Unicode escape converter

Choose a direction and a format. In escape mode, non-ASCII characters are written as code points for source code or HTML. In unescape mode, any mix of the supported forms is turned back into real characters.

Direction

Processed 14 characters.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Pick Text to escapes or Escapes to text.
  2. For escaping, choose the format. ASCII letters, digits and punctuation stay as they are unless you turn on “Escape ASCII characters too”.
  3. Paste the text and copy the result.

How it works

The text is read by code point. In the \uXXXX format each UTF-16 code unit becomes four lowercase hex digits, so characters above U+FFFF give two escapes. The other formats write the full code point in braces, in decimal or hex HTML references or in U+ notation. Decoding looks for the supported patterns and replaces each with its character.

Worked example

“é😀” in the \uXXXX format is é😀. The high surrogate of 😀 is 0xD800 + (0xF600 >> 10) = 0xD83D and the low surrogate is 0xDC00 + (0xF600 & 0x3FF) = 0xDE00, where 0xF600 is U+1F600 minus 0x10000. As HTML decimal references it is é😀.

Tips

Escaping is useful for files that must stay ASCII, such as older config files or e-mail templates. To see what a mystery character is, use the Unicode lookup tool. For quotes and backslashes in code strings, use the string escape tool.

Frequently asked questions

Why is an emoji two escapes in the \uXXXX form?

The \uXXXX form holds exactly one UTF-16 code unit, so a character above U+FFFF is written as a surrogate pair. 😀 (U+1F600) is 😀. The \u{1F600} form, the HTML references and U+ notation use the code point itself.

Which forms can it decode?

\uXXXX (four hex digits, so a surrogate pair joins into one character), \u{X} with 1 to 6 hex digits, \xHH, HTML numeric references in decimal and hex, and U+ followed by 4 to 6 hex digits. Named HTML entities such as é are not handled here, so use the HTML entities tool for those.

Is \u{...} supported in JSON?

No. JSON strings allow only the four-digit \uXXXX form, so use that format, with surrogate pairs for emoji. The braces form is valid in JavaScript source from ES2015 onwards, and in Rust and some other languages.

What happens with an invalid code point?

A value above U+10FFFF is left as typed. A lone surrogate such as \ud83d is decoded as a lone surrogate, which most programs cannot display properly.

More in Text

All tools in this category: Text ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.