Online Tree Viewer:
See the structure of any JSON5 or JSON file as a collapsible tree.
Paste a document and the viewer parses it with the reference JSON5 parser, then draws every object, array and value as a tree you can open and close. Keys, strings, numbers, booleans and null are colored by type, and the counts under the tree tell you how many values the document holds and how deeply it nests.
It is the quickest way to read a large config or an API response without scrolling through braces. If the text does not parse, you get the line, column and surrounding lines of the error instead. Everything runs locally in your browser; nothing is uploaded.
TL;DR: Paste JSON5 or JSON below to see it as a tree. Click a key to open or close it, or use Expand all and Collapse all. Values are what the parser produced, so comments are not shown and 0x1F90 appears as 8080.
View JSON5 as a Tree
A sample service config is loaded. Replace it with your own text.
Tree
Private by design: parsing and drawing happen in your browser. Your text is never uploaded, logged or sent to any server, and it is gone when you close the tab. Open file and drag and drop read the file inside your browser. Copy link puts the text in the part of the address after the # sign, which browsers do not send to any server.
How to Read the Tree
- Objects and arrays show a small arrow and a summary such as
ObjectorArray[3]. Click the row to open or close it. - Closed nodes preview their contents when you hover over them, so you can find the branch you want without opening everything.
- Values are colored by type: strings, numbers, booleans and
nulleach have their own color, so a quoted"8080"is easy to tell from the number8080. - Long arrays are split into groups of 100 so a large data file stays responsive.
- The tree opens two levels deep when it is first drawn. Expand all opens every level; Collapse all closes everything below the top.
The summary under the tool counts every value in the document (including the containers), the number of objects and arrays, and the deepest level of nesting, counting the top-level value as level 0.
The Tree Shows Parsed Values
The viewer draws the data the parser returns, not the text you typed. That is what a program reading the file will see, which is usually what you want to check, but it means some things in the source do not appear:
| In your text | In the tree |
|---|---|
Comments (// ... and /* ... */) | Not shown; comments are not data |
0x1F90, +5, .5 | 8080, 5, 0.5 |
Infinity, NaN | Shown as the numbers Infinity and NaN |
| Single-quoted strings, unquoted keys | Plain strings and keys |
| A repeated key | Only the last value, which is what the reference parser keeps |
| A trailing comma | No trace; it changes nothing in the data |
To check exactly which syntax a file uses, keep the source next to the tree, or run it through the validator. To change the text and keep its comments, see editing JSON5 without losing comments.
When a Tree Helps
Reviewing a large config. A service or build config of a few hundred lines is hard to follow in text. Collapse everything, then open one branch at a time.
Checking what a typo did. A missing comma or an extra brace can put a key inside the wrong object while the file still parses. In the tree, a key that sits at the wrong level is obvious.
Reading an API response. Paste a one-line JSON response and read it as a tree. JSON is valid JSON5, so any JSON works.
Confirming types. The colors show whether a version, port or flag is a string or a number, a common source of bugs when a file is edited by hand.
FAQ
Why are my comments missing from the tree?
The tree shows parsed data, and a parser discards comments. Your input text is unchanged.
Does it work with plain JSON?
Yes. Every JSON document is valid JSON5.
How large a file can it show?
It depends on your device. Parsing and drawing happen in the browser tab, and long arrays are grouped to keep the page responsive. For multi-megabyte files, a desktop browser works best.
Is my text uploaded?
No. Nothing leaves your browser.
The tree is drawn by json-formatter-js 2.5.23 by Mohsen Azimi (MIT license), and parsing uses the reference json5 library, both bundled with this site.
JavaScript
Python
TypeScript
Node.js
Rust
Java
C#
Ruby
Kotlin
Lua
Babel
Vite
webpack
ESLint
Prettier
VS Code
JetBrains