JSON Unescape

Turn an escaped JSON string back into readable text.

Reverse
Input
TEXT input
Output
Result

About this tool


Unescaping expands the backslash sequences in a JSON string back into the characters they represent, turning a single unreadable line into the multi-line text it encodes.

This is what you need when a log entry, an error message or a certificate has been stored as a JSON string and you want to read it, particularly for stack traces, where the content is meaningless until the \n sequences become real line breaks.

How to use it

  1. Paste or upload your textDrop a file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input; open Options to change the behaviour.
  3. UnescapePress Unescape, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Copy or downloadCopy the result, or download it as a .txt file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

An escaped stack trace

Input

Error: failed\n    at run (app.js:10)\n    at main (app.js:20)

Output

Error: failed
    at run (app.js:10)
    at main (app.js:20)

The \n sequences become real line breaks, making the trace readable.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

Quoted or unquoted input both work
Paste the value with its surrounding double quotes or without them; both are accepted. That saves trimming quotes off a value copied out of a JSON document.
Every JSON escape is handled
The short forms \n \r \t \b \f \" \\ and \/ are expanded, as are \uXXXX escapes including surrogate pairs, so escaped emoji reassemble correctly.
Invalid escapes are rejected
JSON defines a closed set of escape sequences. Something like \q or \x41 is not valid JSON (\x is a JavaScript form, not a JSON one), so the tool reports the problem rather than guessing. Use the Unicode Unescaper for mixed-language escape forms.

Limitations


  • Accepts only valid JSON escape sequences; JavaScript-specific forms such as \x are rejected.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


Do I need to remove the surrounding quotes?
No. Input is accepted with or without them.
Why does \x41 fail?
Because \x is a JavaScript escape, not a JSON one. JSON allows only \uXXXX for code points. Use the Unicode Unescaper for JavaScript-style escapes.