JSON Tree Viewer
Validate, format, and interactively explore any JSON document.
JSON input
Valid · 29 lines · 0.39 KB
Tree
What is a JSON Tree Viewer?
A JSON tree viewer is an interactive visualiser for JSON data. You paste a document on the left, the tool parses it, and a browsable tree appears on the right — keys and values at each level, collapsible sub-trees, type-coloured leaves, and a search that highlights matches. It is the quickest way to find a nested key in an API response, reason about a 10,000-line configuration file, or explain a GraphQL result to someone who has not seen it before.
Raw JSON is compact but terrible for human comprehension past about 20 lines. The canonical developer experience is to minify JSON for wire transfer and expand it for inspection; a viewer handles both sides of that loop. Our tool offers Format (pretty-print with 2-space indentation, the de-facto web standard), Minify (single-line, zero whitespace — the smallest valid JSON), and a live tree view that lets you click any node to collapse or expand it. The tree colour-codes values by type: strings green, numbers blue, booleans purple, and null a muted grey italic. Arrays and objects show their child count at a glance.
Parse errors are the common pain point with raw JSON and we try to make them productive. When the document is invalid the input panel shows the native parser's error message plus an approximate line number derived from the reported character offset. The tree clears to prevent false impressions. The most common causes are trailing commas (valid in JavaScript, invalid in JSON), single quotes where doubles are required (ditto), and unescaped backslashes in strings.
Search filters both keys and values — type a substring and the tool highlights every node whose key or value contains it. Useful when you have an API response with dozens of similarly-named fields and you're looking for a specific ID, a known error message, or a field whose name you've half-remembered. Unlike grep, the viewer preserves the surrounding structure so you can see where in the document each match lives.
Privacy matters because API responses often contain sensitive data — bearer tokens, PII, internal IDs, embargoed content. This tool runs entirely in your browser. Nothing you paste is uploaded or logged. A common mistake when using other free JSON viewers is pasting live production responses into a service whose terms of use you haven't read; ours avoids that risk by construction.
JSON's spec (RFC 8259) is small: six data types (string, number, boolean, null, array, object), strict quoting rules, no comments, no trailing commas. If you need a relaxed syntax with comments and trailing commas, look for a JSON5 parser — not this tool. If you need YAML, TOML, or HCL, those are separate tools. Sticking to strict JSON keeps the viewer fast and the error reporting crisp.
How to use the JSON Tree Viewer
- Paste JSON into the input panel. Any size works; the tree is virtualised for large documents.
- Click to expand or collapse any node. Use the +/- buttons to open or close everything at once.
- Search for a key or value; matches are highlighted wherever they live.
- Format or minify using the buttons above the input — they rewrite the input panel in place.
- Copy minified or download pretty-printed using the output panel's action buttons.
Features
- Interactive collapsible tree with type-coloured leaf values.
- Format and minify in one click with round-trip fidelity.
- Substring search that highlights both keys and values.
- Friendly parse errors with line-number hints.
- Expand-all and collapse-all controls.
- Runs in your browser — no JSON ever uploads.
Frequently asked questions
- Why won't my JSON parse?
- Strict JSON disallows trailing commas, single quotes, comments, and bare keys. Every key must be a double-quoted string; every string must use double quotes; no trailing comma before ] or }. If you're dealing with relaxed JS syntax, look for a JSON5 parser.
- What's the difference between format and minify?
- Format pretty-prints with indentation — use it when reading or debugging. Minify strips every whitespace character — use it when sending over the wire. Both produce the same underlying data; they're inverses.
- Can I view very large JSON files?
- The viewer handles files up to several MB comfortably. For multi-GB files, consider a streaming parser or command-line tools like jq — browser JSON parsers load the full document into memory.
- Is my JSON sent anywhere?
- No. The entire tool runs in your browser. We do not log, upload, or transmit any of your data — important when inspecting API responses that contain tokens or PII.
- Does the tool validate against a schema?
- Not yet. It validates syntax (the document is parseable) but not structure against a JSON Schema. A schema validator is on the roadmap — contact us if you'd like to prioritise it.
- How can I search nested keys?
- Type a substring into the search box. Matches in any key name or value at any depth are highlighted. Use multiple searches to narrow in on specific paths.