JSON Tree Viewer · TreeView JSON

Explore large JSON as a collapsible tree, with search by key.

Updated:

100% client-side

Input

0 characters

Tree

Paste some JSON on the left to see the tree.

—

What the JSON tree viewer does

JSON is a common way to structure data as nested objects and lists, but a large JSON file printed as flat text is hard to read — everything runs together. TreeView JSON turns that text into an interactive, collapsible tree, the same way your browser's developer tools display it, so you can expand only the parts you care about and find a specific key without scrolling through thousands of lines.

How to use the JSON tree viewer

  1. Paste your JSON into the Input panel on the left, or click Example to load a sample.
  2. The Tree panel on the right builds the collapsible view automatically.
  3. Click any node to collapse or expand it, or use Expand all / Collapse all.
  4. Type in the "Search by key…" box to jump straight to matching branches.
  5. Use Clear to start over.

How the tree explorer works

A tree viewer turns the nested structure of a JSON document into collapsible nodes: every object or array can be collapsed to hide its children, and every primitive value (string, number, boolean, null) is shown colored by type, just like in your browser's DevTools:

{
  "user": {         → collapsible node {2}
    "id": 42,        → number
    "roles": [...]   → collapsible node [2]
  }
}

This tool uses native JSON.parse to validate and walk the tree, rendering each node as DOM elements — no external libraries, no server calls.

Examples

1. Get the shape of a document at a glance. Paste an order and the tree shows each object with its size in braces and each array with its length in brackets, so you know what is inside before opening it:

Input:
{"order":{"id":1042,"customer":{"name":"Ada","email":"ada@example.com"},"items":[{"sku":"A-17","qty":2},{"sku":"B-03","qty":1}]}}

Tree:
▾ {1}
  ▾ "order": {3}
      "id": 1042
    ▸ "customer": {2}
    ▸ "items": [2]
13 nodes

2. Find every occurrence of a key. Typing sku in the search box hides everything else and opens just the branches that lead to a matching key:

Search: sku

▾ {1}
  ▾ "order": {3}
    ▾ "items": [2]
      ▾ 0: {2}
          "sku": "A-17"
      ▾ 1: {2}
          "sku": "B-03"
7 nodes (filtered)

3. Read a large API response one level at a time. Collapse all folds the document down to its top-level keys; then open only the branch you are debugging. It is the same interaction as the Network panel's preview in browser DevTools, without having to reproduce the request there.

Common surprises when exploring JSON

  • Big integers lose precision. JavaScript numbers are exact only up to 253 − 1 (9,007,199,254,740,991). An ID such as 1234567890123456789 is displayed as 1234567890123456800 — the parsing changed it, not your data. APIs that use 64-bit IDs (X/Twitter, Discord) send them as strings for this reason; if yours sends numbers, read the raw text instead.
  • Duplicate keys disappear. {"role": "user", "role": "admin"} shows a single "role": "admin": when a key repeats, the last value wins. RFC 8259 says keys should be unique, and different parsers resolve duplicates differently, so a duplicate is worth fixing at the source.
  • Search looks at keys, not values. Searching Ada in the example above finds nothing because Ada is a value. Search for the key (name) instead, or find the text with your browser's Ctrl+F in the formatted output of the JSON Formatter.
  • Invalid JSON shows no tree. A trailing comma or a single quote stops parsing; the error panel gives the position, for example Expected double-quoted property name … (line 1 column 9) for {"a": 1,}. Fix it and the tree appears immediately.
  • Huge documents feel slow. Every node becomes a DOM element, so tens of thousands of keys take a moment to draw. Collapse all, or extract the part you need with jq first.

JSON tree viewer vs. other ways to explore JSON

Firefox opens any .json URL in its own collapsible viewer, and Chrome's DevTools show a tree in the Network panel's Preview tab — handy when the JSON comes straight from a URL you can load. On the command line, jq 'keys' data.json lists the top-level keys and jq '.order.items[].sku' data.json pulls out one field from every item. This page fits the case in between: JSON you already have on your clipboard, too large to read as text, where you want to click through it. To get the exact path expression for a node, use the JSON Path Visualizer; to compare two documents, the JSON Diff.

Frequently asked questions

How does the key search work?

It filters the tree to show only the branches whose key contains the searched text (or that have a descendant that does), auto-expanding them and highlighting the match.

How large can the JSON I explore be?

It works well with documents with thousands of nodes. Extremely large documents (tens of thousands of keys) can get slow because the whole tree is rendered in the DOM.

Does it visually distinguish data types?

Yes: strings, numbers, booleans and null have distinct colors, and objects/arrays show how many elements they contain between braces or brackets.

Is it safe to paste sensitive data here?

Yes. All processing and rendering happens in your browser; no data is ever sent to a server.