handy.moe

All tools / Debug tools

A digital stamp on a phone

Unicode escape and unescape

Turn characters into \uXXXX style escapes, or turn escapes back into text, and see the code point and UTF-8 bytes of every character.

Runs in your browser. Pasted data never leaves it.

How to use it

  1. Paste text, or text that contains escapes.
  2. Choose an escape style and press Encode; press Decode to turn escapes back into characters.
  3. The list under the boxes shows every character's code point and UTF-8 bytes.
  4. Copy the result.

Questions

What are Unicode escapes for?

They write characters using only ASCII, which is safe for source code, JSON, logs and config files. \u00e9 is é. Characters outside the first 65,536 (emoji, many rare characters) need a surrogate pair in JavaScript and JSON: \ud83d\ude00 is 😀, or \u{1F600} in ES6 code.

Which styles does it understand when decoding?

\uXXXX, \u{X…}, \UXXXXXXXX, \xHH, %uXXXX, U+XXXX, CSS \XXXX and HTML &#xXXXX; / &#NNNN;, plus the common backslash escapes such as \n and \t. Mixed input is fine.

Why do I get two escapes for one emoji?

JSON and Java use UTF-16, in which a character above U+FFFF is two 16-bit units (a surrogate pair). Choose ES6 or Python style to get one escape per character.

Can I see what is in my text?

Below the boxes, each character is listed with its code point and UTF-8 bytes: useful for hunting invisible characters such as zero-width spaces.

Is what I paste or test sent anywhere?

No. This page works entirely inside your browser, and pasted data never leaves your device. It makes no network requests while you use it, and the page also tells your browser to block them (a Content-Security-Policy with connect-src 'none'), so even a bug could not send your data out. To check it yourself, open your browser's developer tools, go to the Network tab, and use the tool: nothing will appear. There is no account, no analytics and no logging.