JavaScript string unescape

Paste a string from code or an error log to see the text as the user would.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter encoded text and remove surrounding quotes.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The text is read with ECMAScript string rules: \n newline, \t tab, \xHH a hex character, \uXXXX a UTF-16 unit, \u{H} a full code point, and backslash plus newline is dropped. Any other character after a backslash stands for itself.

Example

Inputs: Remove surrounding quotes = yes. Result: Unescaped text: مرحبا "ToolSahla" 😀; Characters: 19.

"\u0645\u0631\u062D\u0628\u0627\n\"ToolSahla\" \u{1F600}"
مرحبا
"ToolSahla" 😀

Limits and caveats

  • Legacy octal escapes like \1 are rejected, as strict mode forbids them.
  • Template ${x} expressions are not evaluated; they stay as text.

Questions about this tool

Does it work for JSON strings?

Yes. Every valid JSON escape is also valid JavaScript, so JSON strings decode the same way.

What is the difference between \uXXXX and \u{XXXXX}?

The first is exactly one 4-digit UTF-16 unit; the second takes any code point up to 10FFFF, such as emoji.

Does the tool run the code?

No. It reads the text character by character and never executes anything.