Unicode decoder — turn \u escapes and U+ codes back into text

Paste a string full of escape sequences and read the real characters. JavaScript, JSON, Python and C escapes, U+ code points and numeric HTML references are all decoded, even when mixed together.

Live demo · real result from this tool

Decoded text

Café ✓ 😀 👋 🚀

Processed on your device — nothing is uploaded.

How to use the Unicode decoder

  1. Paste the escaped text into Text with escapes. Plain words around the escapes are fine.
  2. The Decoded text appears straight away, with every escape it recognises replaced by its character.
  3. Copy the result. Anything that is not a recognised escape is passed through unchanged.

What it does and when to use it

Escaped text turns up in many places: JSON from an API that writes \u00e9 instead of é, a log line full of \uD83D\uDE00, a Java properties file, Python source with \U0001F600, or a design spec that lists characters as U+2192. This tool makes all of those readable in one step, so you can check what a string really says.

It is the reverse of the Unicode encoder. If you want to know more about a single decoded character, such as its official name, block and UTF-8 bytes, paste it into the Unicode character lookup. For text that also contains named HTML entities like é, use the HTML decoder instead, because this tool decodes only the numeric forms.

How it works

The decoder runs a series of search-and-replace passes in a fixed order:

  1. Surrogate pairs written as two \u escapes are joined into one character first, so emoji come out whole.
  2. \u{…} and \U plus eight digits are decoded as full code points.
  3. Remaining \uXXXX escapes become single UTF-16 units. A run of \xXX escapes is decoded as UTF-8 bytes, or as Latin-1 characters when the bytes are not valid UTF-8.
  4. U+XXXX codes are decoded. A single space between two U+ codes is treated as a separator and removed; a space before ordinary text is kept.
  5. Hex and decimal HTML references are decoded last.

Code points above U+10FFFF, and surrogate values in the full code point forms, are left as written. It all runs in your browser.

Worked examples

Caf\u00E9 \u2713 \uD83D\uDE00 \u{1F44B} U+1F680   →  Café ✓ 😀 👋 🚀
\x48\x69 \U0001F600                              →  Hi 😀
Price: €5 €5                        →  Price: €5 €5
\xc3\xa9                                         →  é

The first line mixes four styles in one string, which is common when text has passed through several systems. The last line shows two byte escapes read together as the UTF-8 encoding of é.

Limits and tips

  • The space between U+ codes is dropped, but not the one before a word, so U+0048 U+0069 there decodes to “Hi there”.
  • If the output still contains odd pairs such as é or ’, the text was decoded with the wrong character set somewhere earlier. Look at its bytes in the hex dump viewer.
  • Upper and lower case hex digits both work.

Frequently asked questions

Which escape formats does it understand?
\uXXXX (including surrogate pairs such as \uD83D\uDE00), \u{…} with 1 to 6 hex digits, \U followed by 8 hex digits, \xXX, U+XXXX with 4 to 6 hex digits, and HTML numeric references in hex (€) or decimal (€). Anything else is left exactly as it was.
Are \xXX escapes read as UTF-8 bytes?
Yes. A run of \xXX escapes is decoded as UTF-8, so \xc3\xa9 gives é. If the bytes are not valid UTF-8, each one is read as a single Latin-1 character instead, so \xe9 on its own also gives é.
Are \n and \t decoded?
No. This tool handles Unicode escapes only. \n, \t, \" and other string escapes stay as typed. A JSON or string unescaper is the right tool for those.
What happens to an invalid code point?
Values above U+10FFFF and lone surrogate numbers written as \u{…}, \U, U+ or &#…; are kept as the original text, so nothing is silently lost. A lone \uD83D on its own is decoded but cannot display, so it usually shows as a replacement box.
Is this decryption?
No. Escapes are only a different spelling of the same characters, with no key involved. Anyone can decode them.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close