JSON Unescape — Decode Escaped JSON Strings Online
Paste an escaped JSON string and get the readable text back. Decodes \n, \", \\ and \uXXXX one layer at a time, handles double-escaped input, and keeps literal backslashes in Windows paths intact.
Escaped JSON turns up whenever a string has been through a serializer: log files, API responses, database columns, webhook payloads, CI output. This tool reverses that, entirely in your browser, so nothing is uploaded. If you need the opposite direction, use JSON Escape.
Updated September 2026 — dedicated unescape tool, split out from the combined escape page.
What is JSON unescaping?
JSON unescaping converts backslash escape sequences inside a JSON string back into the characters they represent. \n becomes a real line break, \" becomes a double quote, \\ becomes one literal backslash, and \u263A becomes ☺. It is the exact reverse of escaping.
Unescaping is not the same as deleting backslashes. A backslash disappears only when it is part of a valid escape sequence; one that stands for itself survives as a single backslash. That is why C:\\temp unescapes to C:\temp and stops there, and why find-and-replace on \ quietly corrupts file paths and regular expressions.
One pass decodes exactly one layer. A string that went through two serializers needs two passes — see double-escaped strings below.
JSON unescape reference table
What each escape sequence decodes back to:
| Escape sequence | Decodes to | Notes |
|---|---|---|
\" | Double quote " | The most common sequence in copied JSON. |
\\ | One backslash \ | Two characters become one. Windows paths rely on this. |
\n | Newline (U+000A) | Becomes a real line break, so output may span several lines. |
\r | Carriage return (U+000D) | Invisible on its own; often precedes \n. |
\t | Tab (U+0009) | |
\b | Backspace (U+0008) | Rare outside generated data. |
\f | Form feed (U+000C) | Rare outside generated data. |
\/ | Forward slash / | The backslash was optional going in, so it simply drops. |
\uXXXX | The character at that code point | e.g. \u263A becomes ☺. Emoji arrive as surrogate pairs such as \uD83D\uDE80. |
\ + anything else | — invalid — | JSON defines no other escapes. \x41 and \' are errors, not characters. |
Anything that is not a backslash sequence passes through unchanged.
How to unescape a JSON string
- Paste the escaped text into the left editor. Surrounding quotes are optional — the tool accepts either.
- Click Unescape → Right. One layer is decoded.
- Check the output. If backslashes remain and you know another layer exists, click Unescape again.
- Copy or download the result.
Input without surrounding quotes
Input (the two characters \n, not a line break):
Line 1\nLine 2
Output:
Line 1
Line 2
Input with surrounding quotes
This tool accepts a quoted string and keeps its surrounding quotes in the displayed output. The decoded line break is real, so what you see is not a valid JSON string literal to paste straight back into a payload.
"Line 1\nLine 2"
Output (surrounding quotes retained):
"Line 1
Line 2"
Remove escape characters from JSON
“Remove the escape characters” almost always means unescape, not strip every backslash. Clicking Unescape → Right removes the backslashes that are part of a valid sequence and keeps the ones that represent a literal backslash.
Deleting every \ with find-and-replace looks identical on simple input and silently corrupts file paths, regular expressions, and any text where a backslash is real data. If backslashes are still visible after one pass, the string carried more than one layer of escaping — decode it one layer at a time rather than removing them by hand.
How to fix a double-escaped string
A string acquires another layer of escaping each time it passes through a serializer. Decode only the number of layers you know were added.
Double-escaped input:
Line 1\\nLine 2
After the first pass (still a literal backslash followed by n):
Line 1\nLine 2
After Unescape again (a real line break):
Line 1
Line 2
Know when to stop
Unescaping C:\\temp\\file.txt once produces C:\temp\file.txt. Stop there if that is the intended path. Another pass would read \t as a tab and \f as a form feed, destroying the path. The Unescape again button appearing does not prove another layer exists — it only means escape sequences are still present, and in a Windows path they are supposed to be.
When unescaped output is not valid JSON
Unescaping returns plain text, not necessarily valid JSON. Decoded output can contain real line breaks and unescaped quotes, both of which are illegal inside a JSON string literal.
If your goal is a parseable object rather than readable text, use JSON Parse, which decodes the string and parses the result in one step. To check whether what you have is valid, use JSON Validator; to repair it, JSON Repair.
Unescape JSON in code
For a one-off the tool above is faster. In a pipeline, use your language's own parser rather than a regular expression — hand-rolled unescaping gets \uXXXX and surrogate pairs wrong.
JavaScript / Node.js
const decoded = JSON.parse('"' + escaped + '"');
Wrapping in quotes turns the fragment into a JSON string literal so the parser handles it. This assumes escaped is properly escaped; if it contains a raw unescaped quote it will throw, which is the correct outcome.
Python
import json
decoded = json.loads('"' + escaped + '"')
Java (Jackson)
ObjectMapper mapper = new ObjectMapper();
String decoded = mapper.readValue("\"" + escaped + "\"", String.class);
Go
var decoded string
if err := json.Unmarshal([]byte(`"`+escaped+`"`), &decoded); err != nil {
return err
}
PHP
$decoded = json_decode('"' . $escaped . '"');
C# (.NET)
using System.Text.Json;
var decoded = JsonSerializer.Deserialize<string>("\"" + escaped + "\"");
Command line (jq)
echo '"Line 1\nLine 2"' | jq -r .
-r is raw output, which prints the decoded text rather than re-quoting it.
Common issues and fixes
- Backslashes remain after unescaping. Either the string was escaped more than once, or those backslashes are literal data. Decode one layer at a time and stop when the output looks right.
- “Invalid escape sequence”. JSON only defines
\" \\ \/ \b \f \n \r \t \uXXXX. Sequences such as\x41,\'or\acome from other languages and are not valid JSON. - Unicode escapes did not decode.
\uXXXXneeds exactly four hex digits. Characters outside the Basic Multilingual Plane, including most emoji, arrive as surrogate pairs like\uD83D\uDE80and only decode correctly when both halves are present. - A Windows path came out mangled. You ran one pass too many.
\tinC:\tempbecame a tab. Start over and stop a pass earlier. - Output will not parse as JSON. Expected — see above. Unescaping produces text, not a document.
- Nothing changed. The input had no escape sequences, or it was already fully decoded.
Unescaping vs URL decoding vs HTML decoding
| Decoding | Looks like | Used for |
|---|---|---|
| JSON unescape | \" \n \u263A | String values inside JSON payloads, logs, config. |
| URL decode | %22 %0A | Query strings, redirects, form parameters. |
| HTML decode | " | Text nodes and attributes in HTML. |
A value copied out of a browser network tab has often been through more than one of these. Work outwards in the order they were applied, checking the result after each step.
FAQs
What does unescaping a JSON string do?
It converts backslash sequences such as \n, \" and \\ back into the characters they represent. It does not delete every backslash — one that stands for a literal backslash survives as a single backslash.
Why are there still backslashes after I unescape?
Either the string was escaped more than once, or those backslashes are literal data such as a Windows path. Decode one layer at a time and stop when the output looks correct.
Is unescaped output valid JSON?
Not necessarily. Unescaping returns plain text, which can contain real line breaks that are not legal inside a JSON string literal. For a whole document, use JSON Parse.
How do I unescape a JSON string in JavaScript or Python?
Wrap the escaped content in double quotes and hand it to the language's own parser — JSON.parse in JavaScript, json.loads in Python. Both decode exactly one layer.
Does this tool upload my data?
No. Unescaping runs entirely in your browser, so it works offline and is safe for confidential payloads.
Can it handle Unicode and emoji?
Yes. \uXXXX sequences decode to their characters, and emoji written as surrogate pairs decode correctly when both halves are present.
What is the difference between unescape and decode?
In JSON they mean the same thing. “Decode” is also used for URL and Base64 decoding, which are different transformations — see the comparison table.
How do I remove escape characters from JSON?
Unescape it. Do not find-and-replace on the backslash character: that removes backslashes that are real data and corrupts paths and regular expressions.
Why did my Windows path break?
You unescaped one pass too many. C:\\temp should stop at C:\temp; another pass reads \t as a tab character.
What characters can appear in a JSON escape?
Only " \ / b f n r t and uXXXX. Anything else after a backslash is an invalid escape sequence.
Related tools: JSON Escape, JSON Parse, JSON Validator, JSON Repair, JSON Formatter, JSON Stringify