Skip to content

JSON Viewer & Editor

Paste or open JSON to explore it as a tree beside the code. Click a node to find its text, copy its JSONPath or JSON Pointer, and search keys and values. The tree follows your edits as you type, and numbers appear exactly as written.

Runs locally in your browser

Input

15 lines · 404 characters
{
  "order": {
    "id": "A-1042",
    "placed": "2026-10-29T09:14:00Z",
    "total": 84.90,
    "customer": { "name": "Grace Hopper", "e-mail": "grace@example.com" },
    "items": [
      { "sku": "KB-201", "title": "Mechanical keyboard", "qty": 1, "price": 69.90 },
      { "sku": "MP-07", "title": "Mouse pad", "qty": 2, "price": 7.50 }
    ],
    "tags": ["gift", "express"],
    "notes": null
  }
}

Tree

The tree of your JSON appears here.

What the JSON Viewer shows

The JSON Viewer draws a JSON document as a tree that you open one level at a time. Every row starts with a key, or with an index such as [2] for an item of an array. A badge gives the type: {} with the number of keys for an object, [] with the number of items for an array, and string, number, boolean or null before a plain value. Numbers keep the characters your text uses, so a price of 19.90 is not shown as 19.9. A string longer than 200 characters is cut short in its row; select it and the full text appears under the tree.

How to view JSON as a tree

  1. Paste JSON into the code view, or open or drop a .json file. The tree fills the other half of the screen; on a phone, the Code and Tree buttons switch between them.
  2. Open a node with the arrow in front of it, or choose Expand to depth to open the first one, two or three levels, or all of them.
  3. Select a node. Its path appears under the tree, with buttons to copy the path, the value or the key. On a wide screen, the node's text is selected in the code at the same moment.
  4. Type a word into the search field. The tree opens at every match, and the arrows beside the field step from one match to the next.
  5. Change the code if you need to. The tree catches up after a short pause, and Download saves your edited version.

The tree also works from the keyboard. Arrow keys move up and down, the right arrow opens a node or enters it, and the left arrow closes it or goes back to its parent. Home and End jump to the first and last rows, * opens every node at the current level, and Enter selects the node's text in the code view.

Examples

An order with every level open

Input

{"order":{"id":"A-17","items":[{"sku":"X1","price":19.90},{"sku":"Y2","price":5}]}}

Output

{} root · 1 key
└─ order {} · 2 keys
   ├─ id "A-17"
   └─ items [] · 2 items
      ├─ [0] {} · 2 keys
      │  ├─ sku "X1"
      │  └─ price 19.90
      └─ [1] {} · 2 keys
         ├─ sku "Y2"
         └─ price 5
Paths of keys with spaces, dashes, slashes and tildes

Input

{"user name":{"e-mail":"ada@example.com","flags":{"a/b":true,"x~y":null}}}

Output

$["user name"]                 /user name
$["user name"]["e-mail"]       /user name/e-mail
$["user name"].flags           /user name/flags
$["user name"].flags["a/b"]    /user name/flags/a~1b
$["user name"].flags["x~y"]    /user name/flags/x~0y
A comma deleted while editing

Input

{
  "name": "Ada",
  "langs": ["en", "fr"]
  "active": true
}

Problem reported

Line 4, column 3: Expected a comma before this member. Put a comma between the two. (JSON_MISSING_COMMA)

In the last example the tree keeps showing the document as it was before the comma went missing, with a Stale badge, until the comma is back.

JSONPath or JSON Pointer

Both formats name the place of one value, but they come from different standards and tools expect one or the other.

  • JSONPath (RFC 9535 (opens in a new tab)) starts with $ for the whole document. A key made of ASCII letters, digits and underscores, not starting with a digit, follows a dot; any other key goes in brackets as a quoted JSON string, and an array index goes in brackets as a number: $.order.items[1].price, $["user name"].
  • JSON Pointer (RFC 6901 (opens in a new tab)) puts a slash before each step: /order/items/1/price. Inside a step, ~ is written ~0 and / is written ~1, so the key a/b becomes a~1b. The whole document is the empty pointer, and a key that is an empty string is a lone /.

Where each one fits:

  • jq filters use the JSONPath form without its $. Remove the $ when a dot follows it, and replace it with a dot when a bracket follows it: $.order.items[1].price becomes .order.items[1].price, and $["user name"] becomes .["user name"].
  • JSON Schema validators report where a document breaks a schema as a JSON Pointer, such as Ajv's instancePath.
  • JSON Patch (RFC 6902 (opens in a new tab)) takes a JSON Pointer in the path of each operation: {"op": "replace", "path": "/order/items/1/price", "value": 6}.

The Path format option decides which form the viewer shows and copies. When an object repeats a key, neither format can tell its members apart; the viewer then warns that the path matches more than one value.

Finding a key or value

Search looks through keys and values at once, or only one of them with Search in. It ignores upper and lower case and reads escapes the way a program would, so été finds a string written as "\u00e9t\u00e9". Numbers, true, false and null are matched against their text, which means 19.9 finds 19.90. Objects and arrays never match as a whole; their keys and values do.

Every match is highlighted, and the nodes above it open so that it can be seen. The counter beside the field says which match is selected and how many there are; Enter goes to the next one and Shift+Enter to the previous one. The list holds the first 1,000 matches, and the counter still gives the total. In a long API response, searching for a field name, such as status with Search in set to keys, is usually quicker than opening levels by hand.

Editing with a live tree

You edit in the code view, and the tree follows: after you stop typing for a moment, the code is read again and the tree is rebuilt. Nodes you opened stay open and the selected node stays selected, as long as their paths still exist. Clicking a node selects its text in the code, and moving the cursor in the code selects the matching node in the tree.

While the code is not valid JSON, the tree shows the last version that was, marked Stale, and the problems are listed under the tool and underlined in the code. The badge disappears once the code is valid again. For input of 1 MB or more, the tree waits for Show tree or Ctrl+Enter instead of following every pause in typing.

Working with large JSON files

The viewer accepts up to 10 MB. Parsing runs in the background, so the page stays responsive while a big file opens, and the tree draws only the rows on screen. A node with many children shows the first 200 of them, followed by a Show next 200 row.

From 5 MB or 100,000 values, the viewer switches to large document mode and says so under Problems. The tree opens at its top level, Expand to depth is turned off, and searching waits for the Search button, since each search reads the whole document again. To reach a value deep inside a large document, search for its key and step through the matches.

Options

Options
OptionValuesDefaultWhen to change it
Expand to depth1 level, 2 levels, 3 levels, All levels1 levelHow many levels the tree opens on its own. Choosing a value also closes the nodes you opened by hand. Large documents always open at the top level.
Path formatJSONPath, JSON PointerJSONPathThe form of the path under the tree, and of the path Copy path puts on the clipboard.
Search inKeys and values, Keys, ValuesKeys and valuesWhere the search field looks for its text.
Allow comments (JSONC)On, OffOffTurn it on to view files with // or /* */ comments or with trailing commas, such as VS Code settings. The comments stay in the code but have no node in the tree.

Common errors and fixes

Common errors and how to fix them
CodeWhat it meansHow to fix it
JSON_MISSING_COMMAErrorAn edit removed a comma between two items or members, often when a line was moved or added.Put the comma back at the end of the line before the reported position; the tree stops being stale.
JSON_DUPLICATE_KEYWarningAn object has the same key more than once. The tree shows each member as its own node, marked duplicate.Delete or rename the member that should not be there. Until then, paths to that key are ambiguous.
JSON_NUMBER_UNSAFE_INTEGERNoteAn integer is beyond 9,007,199,254,740,991, the largest that JavaScript holds exactly. The node shows it as written, with a small note mark.Nothing to fix in the viewer. Programs that read the value need a big-integer parser, or the value as a string.
JSON_DEPTH_LIMITErrorObjects and arrays are nested more than 512 levels deep, which no tree can show usefully.Check how the document was generated; such depth usually comes from a runaway loop or a recursive structure.
JSON_LARGE_DOCUMENTNoteThe document is over 5 MB or has more than 100,000 values, so large document mode is on.Nothing is wrong. Search for keys to reach deep values, and press Search to run a search.

Any other syntax error also stops the tree from updating. The JSON Formatter explains every syntax error with examples of the fix, and the JSON Minifier turns a document you have checked here into a single line.

Privacy

JSON Viewer & Editor runs entirely in your browser. What you type, paste or open is processed on your device: it is not sent to Toolzami, and Toolzami does not store it. Only the options you choose are remembered, in this browser.

Frequently asked questions

Why does the tree show two nodes with the same key?

Your JSON repeats a key inside one object. JSON.parse keeps only the last of them, so viewers built on it show a single node; this tree shows each member with a duplicate badge, and warns that their path matches more than one value.

Does viewing or copying change my JSON?

No. The tree reads your text without rewriting it: 19.90 stays 19.90 and a 20-digit ID keeps every digit. Copy value copies a node's text as it appears in the code, and Download saves the code as you edited it.

Can the viewer load JSON from a URL?

No. The page never sends requests on your behalf, so it cannot fetch an API response. Open the URL in a browser tab or with curl, then paste the response or save it as a file and open it here.

Last updated