About the JSON Unstringify
Turn stringified JSON (full of \" escapes) back into normal, formatted JSON. Multiple levels of stringification are unwrapped automatically.
Key features
- Converts stringified JSON back into normal JSON
- Unwraps multiple levels of escaping automatically
- Pretty-prints the result with your choice of indent
- Clear errors for broken escape sequences
- Perfect for log lines and queue messages
- Runs locally, nothing uploaded
Undo JSON.stringify
Stringified JSON is JSON that has been turned into a string, often more than once, as it passes through loggers, message queues and APIs. It's full of backslashes and impossible to read:
"{\"user\":{\"id\":42,\"roles\":[\"admin\"]},\"ok\":true}"
JSON Unstringify parses it repeatedly until it reaches the real data:
{
"user": {
"id": 42,
"roles": ["admin"]
},
"ok": true
}
Levels of escaping
| Level | Looks like |
|---|---|
| 0 (normal JSON) | {"a":1} |
| 1 (stringified) | "{\"a\":1}" |
| 2 (stringified twice) | "\"{\\\"a\\\":1}\"" |
Each level adds another layer of backslashes. Unstringify removes them all.
Where it comes from
- CloudWatch, Datadog and ELK logs, where the log
messagecontains a JSON string. - AWS SQS / SNS messages relayed through Lambda.
- Redis / localStorage values.
- Postman collections and test fixtures stored as strings.
- Buggy services that call
JSON.stringifyon data that's already a string.
Fixing double encoding at the source
If your API returns stringified JSON unintentionally, look for code that serializes twice. A common example in Node.js:
// Wrong: body is already a string
res.json(JSON.stringify(data));
// Right
res.json(data);
Related tools
Create stringified JSON with JSON Stringify. For plain text strings with escapes (not JSON), use JSON Decode.
How to use the JSON Unstringify
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The result appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.