About the JSON Parser
Parse a JSON string, even one that is escaped or double-encoded, into a readable structure. Useful for log lines and API responses that wrap JSON inside strings.
Key features
- Parses plain, escaped and double-encoded JSON
- Unwraps up to five levels of stringification automatically
- Clear parse errors with line and column
- Pretty-printed output with your choice of indent
- Ideal for log lines and message queues
- Private: parsing happens in your browser
What is a JSON parser?
A JSON parser reads JSON text and turns it into data: objects, arrays, strings, numbers, booleans and null. Every programming language has one built in. This online parser lets you do the same thing without writing code, and it's especially good at the awkward cases you meet in real systems.
The double-encoding problem
JSON often gets wrapped inside a string, sometimes more than once. It happens when a log library serializes a message that already contains JSON, when a queue stores payloads as strings, or when a database column holds JSON text inside another JSON document. You end up with something like this:
"{\"event\":\"signup\",\"user\":{\"id\":42}}"
The parser recognises that the parsed value is itself a JSON string and keeps unwrapping until it reaches the real structure:
{
"event": "signup",
"user": {
"id": 42
}
}
Where you'll meet stringified JSON
| Source | Why it happens |
|---|---|
| Application logs | Structured loggers escape JSON message bodies |
| AWS SQS / SNS, Azure Service Bus | Message bodies are strings |
| DynamoDB / SQL text columns | JSON stored as text inside JSON exports |
| Webhooks | Some providers send a JSON string inside a field |
Browser localStorage | Values must be strings |
Parsing in code
// JavaScript
const data = JSON.parse(text);
# Python
import json
data = json.loads(text)
// C#
var data = JsonSerializer.Deserialize<JsonElement>(text);
Each throws an error on invalid input, and the online parser shows the same kind of error but with the line and column, so you can fix the input quickly.
Related tools
To see the parsed structure field by field with types, use JSON Deserialize. To explore it as a tree, open the JSON Viewer. To go back to an escaped string, use JSON Stringify.
How to use the JSON Parser
- 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.