How to read nested JSON in a viewer
Follow objects and arrays without losing your place in a long API response or configuration file.
A JSON document may be valid but hard to scan when objects contain other objects and arrays. A viewer formats that structure, numbers its lines, and lets you collapse branches. It helps you find a value without losing the surrounding structure.
Start with objects and arrays
Curly braces contain an object: named properties such as "user" and "items". Square brackets contain an array: values identified by their position, starting at index zero. These structures can contain each other.
{
"user": { "id": 42, "roles": ["reader", "editor"] },
"items": [
{ "sku": "A1", "quantity": 2 },
{ "sku": "B7", "quantity": 1 }
]
}
Here user is an object, roles and items are arrays, and the second item is another object. The JSON specification defines objects as unordered collections and arrays as ordered sequences. That distinction becomes important when you later compare two documents.
Collapse branches you do not need
Paste the document into the JSON Viewer and choose View JSON. Each line gets a number, and controls beside objects and arrays let you collapse or expand them. Folding hides a branch on screen; it does not remove data from the JSON. Open items when you need a product, then collapse it again to return to the top-level shape.
Line numbers help you point a teammate to a spot in the current formatted view. They are not permanent identifiers: adding an earlier property or changing formatting can move the same value to another line.
Trace a value through its parents
To find the quantity of the second item, follow items, then array index 1, then quantity. That route can be written as $.items[1].quantity, with $ standing for the document root. The viewer is for reading; the Diff Checker uses this kind of path when it reports a changed JSON value.
For a large response, first inspect its top-level keys, then open only the branch relevant to your question. If you need to review a before and after version, send both to Diff Checker rather than trying to spot a small value change by eye.
What if the viewer cannot read the paste?
The viewer accepts valid JSON. A Python repr() such as {'active': True} has single quotes and a Python boolean, so it is not JSON. Convert that paste with the Python dict to JSON converter first. If you only need a readable layout, see format and minify JSON safely.