JSON Parser
Deeply parse and analyze the internal structure of your JSON
Understand how big and how deep your JSON really is
Reading a raw API response rarely tells you how complicated it is. This JSON Parser reads your text, confirms it is valid, and then measures it. Along with a re-indented copy of the data, it reports three numbers: how many nodes the document contains, how many keys appear across all objects, and how many levels deep the nesting goes. Those figures are a fast way to judge whether a payload is a simple flat record or a deeply layered structure that will be awkward to map into code.
Using the parser
- Paste your JSON into the JSON to Parse box. Sample Data fills it with a small example if you want to try the tool first.
- Click Parse & Analyze.
- Check the pink summary strip above the result. It reads in the form Nodes, Keys, Max Depth, each with a number.
- Look at the dark panel underneath, which shows the parsed value re-printed with four-space indentation.
- Use Copy Summary to copy the indented result text. Despite the button name, what lands on the clipboard is the formatted JSON in the panel, not the counters.
What the three counters measure
- Nodes counts every value in the document, including the root, each object, each array and each primitive. A single string counts as one node.
- Keys counts property names in objects only. Array items do not add to it.
- Max Depth starts at 1 for the root and increases for every level of nesting, so a flat object holding numbers has a depth of 2.
For example, an object with one key holding an array of three numbers has five nodes, one key and a depth of 3.
Practical uses
- Estimating the effort needed to model an unfamiliar third-party response before writing classes or types.
- Spotting a runaway nesting level in generated data, for instance a serializer that wraps every item in extra layers.
- Confirming that a pasted snippet is well-formed before feeding it into another tool or script.
- Comparing the size of two versions of a payload after a refactor by looking at node and key totals.
Limits and behavior to expect
The tool relies on the browser's strict JSON parser, so single-quoted strings, comments and trailing commas will trigger an error dialog with the reason. Processing happens in the page with JavaScript, and the output is a re-serialized version of your data, meaning original whitespace and key formatting are not preserved. If two keys in one object have the same name, only the last one survives parsing, so counts reflect the surviving data. Extremely large documents may make the page slow because everything is measured in a single pass in the tab.
Related Tools