Escaped JSON is a JSON document stored inside a string, so every quote is written as \". It shows up in API responses, message queues, log lines and database columns, and it is unreadable as is.
Paste it above. JSON Wrench detects that the string contains JSON, unescapes it and formats the result. There is no button to find: it happens automatically, with a note saying it was unescaped.
Example
"{\"id\":42,\"status\":\"shipped\",\"items\":[\"book\",\"pen\"]}"{
"id": 42,
"status": "shipped",
"items": [
"book",
"pen"
]
}Why JSON gets escaped
It happens when JSON is serialized twice, for example when a service stores a JSON payload as a string field and then the whole response is serialized again. Logging libraries that wrap messages in JSON, AWS and GCP event payloads, and text columns in databases are common sources.
What it handles
- Strings encoded more than once (
\\\"style), peeled back up to five layers. - Unicode escapes such as
\u00e9stay valid JSON.
Doing it in code
In JavaScript, parse twice: JSON.parse(JSON.parse(text)). In Python, json.loads(json.loads(text)). If you find yourself doing this often, fix the producer so it embeds the object instead of a string.
Frequently asked questions
What is the difference between escaped JSON and invalid JSON?
Escaped JSON is valid: it is a single JSON string. It just holds another JSON document inside, so you have to decode it to read the data.
Do I need to remove the outer quotes first?
No. Paste the whole string including its outer quotes and it is detected automatically.