ToolGlint

Unicode Escape and Unescape

Convert text to Unicode escape sequences and code points, or turn escaped sequences back into readable characters.

Paste or type, or drop a file on the box.

This format is used in: JavaScript, JSON, Java, C#.

Runs in your browser. Nothing you enter is uploaded or stored.

How to use the Unicode Escape and Unescape

  1. Choose Escape to turn characters into escape sequences, or Unescape to turn sequences back into text.
  2. Type or paste into the left box. The result appears on the right as you type.
  3. When escaping, pick the format your language expects: \u00e9, \u{e9} or U+00E9.
  4. Tick “Escape every character” to escape plain letters and digits too, not only the non-English ones.
  5. Copy the result, or press Swap to send it back the other way.

Questions and answers

Is my text sent to a server?
No. The conversion runs entirely in your browser. Nothing you type or paste is uploaded, stored or logged.
What is a Unicode escape sequence?
It is a way to write a character using only plain ASCII, by giving its number in the Unicode standard. The letter é is number E9 in hexadecimal, so it can be written \u00e9 in JavaScript, JSON and Java. The program reading it turns the sequence back into the character.
Why does an emoji become two \u sequences?
The \uXXXX form holds four hex digits, which covers the first 65,536 characters. Emoji and many other characters sit beyond that, so they are written as two halves called a surrogate pair: 😀 is \ud83d\ude00. The \u{1f600} form avoids this by allowing more digits.
Which format should I use?
Use \u00e9 for JSON, Java, C# and older JavaScript. Use \u{e9} in modern JavaScript, Rust and Swift, where it is shorter and handles emoji as one sequence. U+00E9 is the notation used in documentation and character charts; it is for people to read and is not accepted by compilers.
Which formats can it unescape?
It reads \u00e9, \u{e9}, \xe9, the eight-digit \U000000e9 used by Python and C, U+00E9, and the HTML forms é and é. They can be mixed with ordinary text in the same input, and anything that is not an escape sequence is left alone.
Why does U+ always escape every character?
Code points are separated by spaces. If ordinary text were left between them, a real space could not be told apart from a separator when converting back, so the tool writes every character, including each space, as a code point.

Related tools