JSON Parser Online
Parse JSON and see exactly what you get: every value with its path and type, escaped or stringified JSON unwrapped, JSON inside strings parsed, and warnings for duplicate keys and numbers too large for JavaScript. Runs in your browser, nothing is uploaded.
JSON Input
Parsed JSON
What Does a JSON Parser Do?
Parsing turns JSON text into data a program can use: objects, arrays, strings, numbers, booleans and null. In JavaScript that is JSON.parse(), in Python json.loads(). This online JSON parser does the same and then shows you the result in detail, so you can see what your code will really receive, including the problems a plain parse hides without any error.
How to Parse JSON Online
- Paste your JSON, drop a .json file on the box, or load it from a link with URL.
- Click Parse JSON, or press Ctrl + Enter.
- Read the Parse Report: the counts, any warnings, and a table with the path, type and value of every item.
- Copy or download the parsed JSON, or send it to another tool with Open in.
What It Finds That JSON.parse Does Not Tell You
| Problem | What JSON.parse does | What this parser shows |
|---|---|---|
Duplicate keys, e.g. "status" twice | Keeps the last value, no error | A warning with the key and where it is |
Large integers like 1849302746519283746 | Rounds them to 1849302746519283700 | A warning with the original and the rounded number |
Stringified JSON: "{\"a\":1}" | Returns a string, not an object | Unwraps it, even when it was stringified several times |
Escaped JSON from a log: {\"a\":1} | Syntax error | Removes the escaping and parses it |
| JSON stored in a string value | Leaves it as text | Parses it into real objects (option) |
Example
{
"id": 1849302746519283746,
"status": "pending",
"metadata": "{\"source\":\"mobile\"}",
"status": "paid"
}{
"id": 1849302746519283700,
"status": "paid",
"metadata": {
"source": "mobile"
}
}The report warns that status appears twice in $ (only "paid" is kept) and that $.id lost its last digits. The metadata string became a real object.
Reading the Paths
Paths start at $, the whole document. $.customer.name is the name key inside customer, $.items[0] is the first item of the items array, and keys with spaces or symbols use brackets, like $["first name"]. The same paths work in the JSONPath Tester.
Parsing JSON in Code
- JavaScript:
const data = JSON.parse(text). Wrap it intry...catch, because invalid JSON throws a SyntaxError. See JSON.parse in JavaScript. - Python:
data = json.loads(text), orjson.load(f)for a file. See JSON in Python. - Large ids: ask the API to send them as strings, as many APIs do with an
id_strfield next to the number.
Tips
- Got an error? The message shows the line and column, and the line is marked red. To fix common mistakes automatically, use JSON Repair.
- Only want to check it? The JSON Validator lists every error. To browse big files, use the JSON Viewer.
- Need the opposite? To turn JSON into an escaped string, use JSON Escape.
Frequently Asked Questions
What is a JSON parser?
A JSON parser reads JSON text and turns it into data a program can use, like JSON.parse() in JavaScript or json.loads() in Python. This online parser also shows every value with its path and type.
How do I parse a JSON string that has escaped quotes?
Paste it as it is, for example {\"a\":1} from a log or "{\"a\":1}" from code. The parser removes the escaping, even several layers, and shows the real JSON.
Why does JSON.parse change my large numbers?
JavaScript numbers are exact only up to 9,007,199,254,740,991. Larger integers, such as 19-digit ids, are rounded. The parser warns about each one so you can send them as strings instead.
Is my JSON uploaded?
No. Parsing happens in your browser and your data never leaves your device.