Skip to the content

Unicode Escape Encoder/Decoder

Write characters as \uXXXX escapes for source code and JSON, or turn escapes back into the characters they stand for.

Only need one direction? Unicode Escape and Unicode Unescape have their own pages.

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

Unicode escapes

An escape writes a character by its number instead of the character itself. é is é and € is €. JavaScript, JSON, Java, C# and Python all understand this form, which makes it a safe way to keep non-ASCII characters in a file that might be opened with the wrong encoding.

What the encoder writes

Each escape is \u followed by exactly four hex digits. Characters outside the first 65,536, which includes most emoji, don't fit in four digits and are written as two escapes, a so-called surrogate pair: 🎉 becomes 🎉. That is what JSON requires and what JavaScript produces.

By default only non-ASCII and control characters are escaped, so the result stays readable. Switch to "Every character" if you want the whole text escaped.

What the decoder reads

  • é, four hex digits
  • \u{1F389}, the braces form from modern JavaScript, with one to six digits
  • \x41, two hex digits
  • U+20AC, the notation used in Unicode charts

Everything else is passed through untouched.

See all 15