FormatterHQ

JSON Tree Viewer

Display JSON as a tree of expandable branches, with the number of keys or items on each one. Filter the tree by key or value, or open every branch at once.

Loading tool…
Ready.

How to use the JSON Tree Viewer

  1. Paste JSON into the editor on the left, drop a .json file on it or choose one with Open. Sample loads a small company record.
  2. The hierarchy is drawn on the Tree tab as you type. Click Sort keys above the editor to order object keys alphabetically.
  3. Expand and collapse branches with the triangles to follow the structure level by level, or use Expand all and Collapse all.
  4. Type in the filter box above the tree to keep only the branches that contain a matching key or value.

The JSON tree: structure before content

A JSON tree shows a document as parents and children: the root object at the top, its keys one level down, and nested objects and arrays branching further below. Looking at JSON this way answers structural questions first. Which keys exist at the top level? Is items a list or a single object? How deep does the nesting go?

Every branch in this JSON tree viewer can be expanded or collapsed, and each shows a count such as "3 keys" or "250 items", so you can judge its size before opening it.

Example

Given this configuration:

{"project":"atlas","env":{"region":"us-east-1","replicas":3},"features":["search","export"]}

the status bar reports Valid JSON · 2 objects, 1 arrays, depth 2. The root, labeled $, opens with three children: project, a leaf holding a string; env, an object with 2 keys; and features, an array with 2 items. Leaves show their values directly, colored by type.

With every branch open, the rows of the tree read:

$: { 3 keys }
  project: "atlas"
  env: { 2 keys }
    region: "us-east-1"
    replicas: 3
  features: [ 2 items ]
    0: "search"
    1: "export"

Array items are labeled with their index. Click any key and the path bar above the tree shows where it sits, for example $.env.replicas, which is useful when you describe the structure in documentation or a ticket.

Sort keys

Sort keys, one of the buttons above the editor, rewrites the JSON text with object keys in alphabetical order at every depth, and the tree follows; in the example, env moves above project. It does not reorder arrays. Because the text itself changes, Copy and Download then give you the sorted document.

Filter the tree

Type part of a key or a value in the filter box above the tree. The tree shrinks to the branches that contain a match, opens them and highlights the matching text, and a counter next to the box shows the number of matches. Letter case is ignored. Clear the box to get the whole tree back.

How the tree behaves with big documents

Only the first two levels are opened for you. Deeper branches are built at the moment you expand them, which keeps the page light even when the document holds tens of thousands of values. Any single branch lists up to 1,000 children and then a "… N more" line; the filter reaches the entries beyond it. Expand all opens up to 5,000 branches in one go, and Collapse all folds the tree back to its top-level keys.

Tree, graph or path list?

The tree is the most compact way to walk a hierarchy. If you prefer boxes connected by lines, the JSON graph visualizer draws the same structure as a diagram. If you need an exact path to use in code or a query, the JSON navigator focuses on paths, and the JSONPath tester lets you run queries against the data.

Frequently asked questions

Can I expand all nodes at once?
Yes. Expand all opens every branch, up to the first 5,000 in a very large document, and Collapse all folds the tree back to its top-level keys. Without them, the tree opens the first two levels and builds deeper levels when you click them.
Does Sort keys change my JSON?
It changes the order only. Sort keys rewrites the text in the editor with the keys of every object in alphabetical order, and the tree is rebuilt from that text. Values and the order of array items stay as they were.
What does depth mean in the status bar?
Depth is the number of levels between the root and the most deeply nested value. An object with only simple values has depth 1, and each nested object or array adds one level.
Can I edit values in the JSON tree?
No, the tree is for viewing. Edit the text in the editor on the left, and the tree is rebuilt a moment after you stop typing.

Last updated October 3, 2026

Related tools

JSON Unflatten Rebuild nested JSON from flat dot-notation keys (a.b.c) or bracket paths (a[0].b), the reverse of JSON flatten. JSON Validator Validate JSON online and find syntax errors fast. Get the exact line and column of each problem and fix broken JSON in one click. JSON Viewer & Beautifier View JSON as a collapsible tree and beautify it at the same time. Explore nested objects and arrays without losing your place. JSON5 Formatter Format and beautify JSON5 with comments, unquoted keys and trailing commas, or convert JSON5 to strict JSON. JSON5 Validator Validate JSON5 syntax online. Check config files with comments and trailing commas and get line and column for each error. JSONL to JSON Converter Convert JSON Lines (JSONL / NDJSON) into a formatted JSON array. Invalid lines are reported with their line number. JSONPath Tester Test JSONPath expressions online against your JSON. Supports filters, wildcards, recursive descent and slices, returning values or paths. String to JSON Converter Convert an escaped JSON string back into formatted JSON. Handles quoted literals, backslash-escaped text and double-encoded JSON. JSON Graph Visualizer Visualize JSON data as a graph of connected nodes. See objects, arrays and values as a diagram of linked boxes with size badges. jq Playground Run jq filters on JSON in your browser with real jq 1.8: live output, -r -c -s -n -S and --arg options, clear errors and a clickable cheat sheet. JSON Cleaner Clean JSON by removing null values, empty strings, empty arrays and empty objects at any depth. Optionally trim whitespace in strings. JSON Decode Online Decode JSON strings online. Convert escaped or encoded JSON text into readable, formatted JSON, similar to json_decode.