Skip to content
LocalOnly

JSON Unescape

Stable

Turn a JSON-escaped string back into readable raw text.

Everything is processed locally in your browser

About JSON Unescape

The JSON Unescape tool reverses JSON string escaping, converting sequences like \n, \t, \", and \uXXXX back into the characters they represent. It is the quickest way to read the real content of a string that was escaped for embedding in JSON, such as a log message or serialized payload. Paste the escaped text and get the original back instantly.

Features

  • Decodes \n, \t, \r, \b, and \f into real whitespace and control characters
  • Converts \uXXXX sequences back to their Unicode characters
  • Unescapes double quotes, backslashes, and forward slashes
  • Accepts input with or without surrounding double quotes
  • Reveals multi-line content that was collapsed into escape sequences
  • One-click copy of the decoded raw text

How to use JSON Unescape

  1. 1

    Paste escaped text

    Add the JSON-escaped string you want to convert back to raw text.

  2. 2

    Unescape

    The tool resolves every escape sequence into its original character.

  3. 3

    Read the output

    See the true multi-line, quoted, or Unicode content clearly.

  4. 4

    Copy the raw text

    Use the decoded string wherever you need the original content.

Examples

Escaped string to raw text

Input

She said \"hello\"\nand left.

Output

She said "hello"
and left.

How JSON string unescaping works

Why escaped JSON turns up everywhere

Escaped JSON is what you get whenever a document has been stored as a string rather than as structured data. Log frameworks are the biggest source: a request body attached to a log line becomes a string field, so every internal quote arrives as `\"`. Read that log and you are looking at `{\"user\":{\"id\":42}}` instead of something you can scan.

Database columns are the second source. A payload kept in a `TEXT` column, an audit trail, or a webhook archive all store JSON as text, and copying a row out of a query result gives you the escaped form. Error messages are the third - an exception that embeds the offending payload has to escape it to fit inside its own message string.

In every one of these cases the document is intact; it is just wearing one layer of string encoding. Unescaping removes that layer and hands back the JSON underneath.

Counting the layers, and knowing when to stop

Escaping can be applied more than once, and each pass doubles the backslashes. One layer gives `\"`, two gives `\\\"`, three gives eight backslashes before a quote. This happens naturally when a log line is itself logged, or when a payload passes through two systems that each stringify it.

You can read the depth straight off the text by counting consecutive backslashes before a quote: one means one layer, three means two layers, seven means three. Unescape once per layer and check after each pass. The signal that you have finished is that the result parses as JSON - if it still starts with `{\"` you have another layer to remove.

Stopping at the right point matters, because unescaping a document that is already clean will damage it. A legitimate `\n` inside a string value - part of the data, not part of the encoding - becomes a real newline, which is then invalid inside a JSON string. Once the output parses cleanly, stop.

Reference

Reading the escaping depth

Count the backslashes before a quote to know how many unescape passes are needed.

What you seeLayersPasses needed
{"a":1}0 - plain JSONNone; unescaping would damage it
{\"a\":1}1One
{\\\"a\\\":1}2Two
"{\"a\":1}"1, wrapped in quotesOne, after removing the outer quotes

Which tool should you use?

These tasks overlap. Here is how to pick the right one for what you are actually doing.

You copied a payload out of a log line or a database column
This is the tool. Unescape it, then format the result to read it comfortably.
The text starts and ends with a quote
It is a complete JSON string value, so a single pass will unwrap it and unescape the contents together.
You are going the other way, preparing text for embedding
The JSON Escape tool escapes contents; the JSON Stringify tool wraps a whole document as a string value.
The result is long, dense ASCII rather than readable JSON
It is probably Base64, not escaped JSON. Try the Base64 Decode tool instead.

Use cases

  • Reading a log message that was stored as an escaped JSON string
  • Decoding a serialized payload copied from a JSON field
  • Recovering the original multi-line text from a single escaped line
  • Inspecting Unicode escapes like \u00e9 as their real characters
  • Debugging double-escaped strings from nested serialization

Troubleshooting common errors

The output still has backslashes before every quote

Why: The text had more than one layer of escaping.

Fix: Run it again. Repeat until the output parses as JSON, then stop - each pass removes exactly one layer.

The output is no longer valid JSON after unescaping

Why: You unescaped one time too many, turning escape sequences that were part of the data into raw characters.

Fix: Go back one pass. The correct stopping point is the first result that parses cleanly.

Unicode escapes remain as \u0041 in the output

Why: Those were double-escaped, so the first pass only removed the outer layer.

Fix: Run another pass, or format the result - a formatter resolves `\u` escapes to their characters as part of re-serialising.

A truncated string produces a replacement character

Why: The text was cut between the two halves of a surrogate pair, leaving an unpaired half that cannot be decoded.

Fix: Retrieve the untruncated original. Once one half of the pair is gone the character is unrecoverable.

Limitations

What this tool deliberately does not do, so you know when to reach for something else.

  • Only one layer of escaping is removed per pass; multiply-escaped text needs multiple runs.
  • There is no way to detect whether the input was escaped at all, so running it on clean JSON will corrupt escape sequences that belong to the data.
  • Unpaired surrogates from truncated input cannot be repaired.
  • The result is not reformatted - pass it to the JSON Formatter afterwards for readable output.

Frequently asked questions

Learn more

Command Palette

Search for a tool or command