What is a JSON viewer?
A JSON viewer shows a JSON document as a tree you can fold and unfold, instead of one endless line or thousands of indented ones. It is what you reach for when an API returns a 200 KB response and you only care about one branch, when you need to understand the shape of an unfamiliar payload, or when you want to count how many items an array holds without scrolling through them.
This page opens the JSON formatter with the Fold / unfold view already selected. Every object and array gets a toggle; a folded block shows how many lines it hides, so the structure of the whole document fits on one screen. Large documents (over 2,000 lines) open folded two levels deep, and big integers keep all their digits. Everything is parsed in your browser, so private API responses never leave your device. If you only need to know whether the text is valid, the JSON validator is the shorter path.
How to view JSON as a tree
- Paste the JSON into Your raw JSON.
- The tree appears in the result panel. Click ▾ next to a line to fold that object or array; click ▸ or the "… N lines" label to open it again.
- Use Collapse all to see only the top level, then open the branch you need. Expand all opens everything.
- Turn off Sort keys if you want the keys in their original order; it is on by default, which helps when comparing two documents.
- The copy button next to the view selector always copies the whole formatted text, folded parts included.
Examples
Folding a nested order
{"order":{"id":1001,"customer":{"name":"Ana","city":"Recife"},"items":[{"sku":"A1","qty":2},{"sku":"B7","qty":1}],"paid":true}}Folding the items array leaves:
{
"order": {
"customer": {
"city": "Recife",
"name": "Ana"
},
"id": 1001,
"items": [ … 9 lines],
"paid": true
}
}Collapse all shows the whole document as "order": { … 17 lines}.
JSON that arrived as an escaped string
Logs often store JSON inside a string:
"{\"user\":\"ana\",\"ok\":true}"With Auto-unescape on, the tool unwraps it and shows the object, with a notice that it did:
{
"ok": true,
"user": "ana"
}IDs larger than JavaScript numbers
{"id": 12345678901234567890} is shown with the exact digits. JSON.stringify(JSON.parse(...)) in a browser console prints 12345678901234567000, which is a different ID.
FAQ
How do I open a very large JSON file?
Paste its content: the viewer draws up to 10,000 visible lines and tells you how many more are hidden; fold sections to reach them. Copying always gives the complete text.
Can I compare two JSON documents?
Use JSON diff, which lines up both and highlights what changed. Keeping Sort keys on here also makes two documents easier to compare by eye.
Can I convert the JSON to YAML or CSV?
Yes: JSON to YAML and JSON to CSV take the same input.
Is the JSON stored or uploaded?
No. Only your options (indent, sorting, view) are remembered in this browser; the JSON itself is never saved or sent.
How to pretty-print JSON in code
JavaScript
console.log(JSON.stringify(JSON.parse(text), null, 2));Python
import json
print(json.dumps(json.loads(text), indent=2, ensure_ascii=False))Go
var out bytes.Buffer
err := json.Indent(&out, []byte(text), "", " ")Bash
jq prints a colored tree in the terminal, and its filters pick a single branch:
jq . response.json
jq '.order.items' response.json