Loading ToolDeck, please wait.

ToolDeck.online

INITIALIZING_

0%
DESIGNED BY SJ VISUAL FLOW STUDIOS
ToolDeck.onlineOpen. Build. Go.

JSON and XML Tree Viewer

Paste JSON or XML and explore it as a collapsible tree. Search keys and values, then run JSONPath queries in your browser. Free, private, and no upload.

Collapsible treeSearchJSONPathJSON and XMLNo upload

Supports $, dot keys, bracket keys, indexes, wildcards ([*], .*), and recursive descent (..name, ..*).

What is a JSON tree viewer?

A JSON tree viewer turns raw JSON text into a hierarchy of nodes you can expand and collapse. Instead of scrolling through thousands of characters on a single line, you open one branch at a time and see how objects, arrays, and values fit together. That makes it far easier to understand an unfamiliar API response, find a nested field, or confirm that a payload has the shape your code expects.

This tool also reads XML. The XML is converted to a JSON tree, so the same search and JSONPath features work for both formats. When you need to change the data rather than read it, use the JSON Formatter, and when you need to see what changed between two versions, use the Diff Checker.

Everything runs locally. Your document is parsed in your browser tab, so API keys, customer records, and internal configuration stay on your device.

What it does

  • Collapsible tree

    Navigate deep JSON and XML structures with expand and collapse controls at every level.

  • Search keys and values

    Type any key name or value and the tree filters to matching branches instantly.

  • JSONPath queries

    Run expressions like $.orders[*].id or $..email and get the matching nodes as JSON.

  • JSON and XML input

    Paste JSON or XML. XML is converted to a JSON tree automatically, with attributes kept as @name keys.

  • Runs entirely in your browser

    Your data never leaves your device. No upload, no server, no logging.

  • Fast on large payloads

    Hand rolled rendering keeps the tree responsive on documents with thousands of nodes.

  • Copy results in one click

    Copy a JSONPath result to your clipboard and paste it straight into code, a ticket, or a test.

  • Free, no account

    No sign-up, no watermark, no daily limit. Open the page and start pasting.

How to use the JSON and XML Tree Viewer

  1. Step 1

    Paste JSON or XML

    Drop in a document, or load one of the samples to see how it works.

  2. Step 2

    Explore and search

    Expand nodes, search keys or values, and inspect the shape of the data.

  3. Step 3

    Run a JSONPath query

    Query with JSONPath to extract exactly the nodes you need, then copy the result.

Example: query a JSON document with JSONPath

Take this small order export. Paste it into the viewer, expand orders, and try the queries below. Each one selects a different part of the same document.

Sample JSON
{
  "orders": [
    { "id": 101, "customer": { "email": "ana@example.com" }, "total": 49.5 },
    { "id": 102, "customer": { "email": "raj@example.com" }, "total": 12 }
  ]
}
JSONPath queries against the sample JSON and what each returns
QueryWhat it selectsResult
$.orders[*].idThe id of every order[101, 102]
$..emailEvery email at any depth["ana@example.com", "raj@example.com"]
$.orders[0].customerThe customer object of the first order{ "email": "ana@example.com" }
$.orders[-1].totalThe total of the last order12

JSONPath cheat sheet

These are the JSONPath features this tool evaluates. Use bracket notation for keys that contain spaces, dashes, or other special characters.

Supported JSONPath syntax with examples
SyntaxWhat it doesExampleSupported
$The root of the document$Yes
.keyA child key$.user.nameYes
['key']A child key in brackets$["first-name"]Yes
[n]An array item by position$.items[0]Yes
[-n]An array item counted from the end$.items[-1]Yes
[*] or .*Every child of an object or array$.items[*]Yes
..Recursive descent, search at any depth$..nameYes
[?(@.price > 10)]Filter expressionNot availableNo
[0:3]Array sliceNot availableNo

How XML is converted to a JSON tree

XML has attributes, text, and repeated elements that JSON does not have a direct equivalent for. The viewer uses a simple, predictable mapping so no data is lost. Exact output can differ slightly for edge cases such as comments and CDATA sections.

Sample XML
<order id="101">
  <item sku="A1">Pen</item>
  <item sku="B2">Ink</item>
</order>
Resulting tree (simplified)
{
  "order": {
    "@id": "101",
    "item": [
      { "@sku": "A1", "#text": "Pen" },
      { "@sku": "B2", "#text": "Ink" }
    ]
  }
}
How XML constructs map to JSON tree keys
XML constructIn the treeExample
Element with child elementsAn object with one key per childorder > item
AttributeA key prefixed with @@id, @sku
Text next to attributes or childrenStored under #text#text
Repeated sibling elements with the same tagAn arrayitem: [ ... , ... ]

Because the result is a normal JSON tree, JSONPath works on it too. In the sample above, $..item selects every item element, and typing @sku in the search box finds every sku attribute.

Common uses

  • Debug API responses

    Paste a response from curl, Postman, or the browser network tab and see the real shape of the data instead of one long line. Collapse what you do not need and search for the field you are chasing.

  • Inspect config files

    Open package.json, tsconfig, Terraform JSON, or app settings as a tree to check nesting and spot keys that sit at the wrong level.

  • Read webhook payloads

    Webhooks from payment, chat, and CI services are often deeply nested. Search for an id or an email and jump straight to the branch that holds it.

  • Explore XML feeds

    RSS, sitemaps, SOAP responses, and older XML APIs become a navigable tree, with attributes and repeated elements made explicit.

  • Learn and test JSONPath

    Try expressions against real data and see matches immediately. It is the quickest way to get the syntax right before you use it in a script, a test, or an API gateway rule.

  • Check data before a migration

    List every occurrence of a key with $..key to confirm that each record has the fields you expect before you move or transform the data.

How it compares

Many online JSON viewers send your data to a server, require an account, or limit how much you can use them. Here is how ToolDeck compares with typical cloud alternatives.

Comparison of ToolDeck with typical cloud alternatives
What mattersTypical toolsToolDeck
Works offlineNoYes, after first load
Sign-up requiredUsuallyNo
File uploadYes, to a serverNever, runs in your browser
WatermarkCommon on free plansNever
Daily usage limitCommonNone
CostCredits or subscriptionFree, unlimited
Search keys and valuesSometimesYes
JSONPath queriesSometimesYes
XML support in the same toolOften a separate toolYes

Which ToolDeck tool should you use?

Which ToolDeck JSON tool fits which task
If you want toUseWhy
Explore nested data, search it, or run JSONPathJSON and XML Tree Viewer (this page)Read only tree with search and queries, for JSON and XML.
Pretty print, validate, minify, or edit JSONJSON FormatterWorks on the text itself, so you can fix and reformat it.
See what changed between two payloadsDiff CheckerSide by side comparison of two blocks of text or code.
Get sample data for a UI or API testJSON Mock Data GeneratorGenerates realistic JSON from a schema.
Verify a value or compare checksumsHash GeneratorCreates MD5, SHA-1, and SHA-256 hashes.

Fixing common JSON errors

The viewer needs valid JSON or XML to build a tree. If you see an error, one of these is usually the cause. Exact wording of the message varies by browser.

Common JSON syntax errors, their causes, and fixes
Typical errorLikely causeHow to fix it
Unexpected token ' or single quotesSingle quotes around keys or stringsUse double quotes everywhere.
Unexpected token } or ]A trailing comma after the last itemRemove the comma before the closing bracket.
Expected property nameA key without quotesWrap every key in double quotes.
Unexpected end of JSON inputThe paste was cut off or a bracket is missingCopy the full document and check that every { and [ is closed.
Unexpected token /Comments such as // or /* */Remove the comments. JSON does not allow them.
Bad control character in stringA raw line break or tab inside a stringEscape it as \n or \t.
Unexpected token < at position 0You pasted HTML, for example an error pageCheck the URL or request that produced the response.

The JSON Formatter can validate and pretty print your text so the exact position of the problem is easier to spot.

Privacy and performance

The page makes no network request when you paste, search, or run a query. Parsing, tree building, and JSONPath evaluation happen in your browser, which is why the tool keeps working offline after the first load and why nothing you paste is stored or logged.

For very large documents, keep the tree collapsed and use the search box to narrow down to the branch you need before expanding it. This keeps the page responsive because child rows are rendered only when you open a node.

More free ToolDeck tools

Questions people ask

Is my data uploaded anywhere?

No. Parsing, tree building, search, and JSONPath evaluation all run in your browser. Your document is never sent to a server, logged, or stored.

What is a JSON tree viewer?

A JSON tree viewer turns raw JSON text into a hierarchy of expandable nodes. Objects and arrays become branches you can open and close, so you can understand the structure of a large document without scrolling through a wall of text.

What is the difference between a JSON viewer and a JSON formatter?

A viewer is for reading and querying: you explore the structure, search, and run JSONPath. A formatter is for editing text: it pretty prints, validates, and minifies. Use the JSON Formatter to change your JSON, then paste it here to inspect it.

What is JSONPath used for?

JSONPath is a query language for JSON, similar to what XPath is for XML. It lets you select specific values from a document, for example every order id or every email address, without writing code.

What JSONPath features are supported?

The root $, dot keys ($.user.name), bracket keys ($["user"]["name"]), array indexes ($.items[0] and negative indexes like $.items[-1]), wildcards ($.items[*] and $.*), and recursive descent ($..name and $..*). Filters, slices, and script expressions are not supported yet.

How is XML handled?

The XML is parsed with the browser native DOMParser and converted to a JSON tree. Attributes become keys prefixed with @, and mixed text content is stored under #text. Repeated child elements with the same tag become an array.

Does it support very large files?

The tree is rendered with plain React and collapsed by default, which keeps the DOM small for typical payloads. Documents with tens of thousands of nodes may feel slow because expansion renders child rows on demand. If you hit lag, use search to narrow branches before expanding.

Can I edit the JSON in the tree?

No. This is a read only viewer and query tool. Edit your JSON with the JSON Formatter tool, then paste the result back here to re-inspect.

Can I export the query result?

Yes. JSONPath results are shown as JSON and can be copied to your clipboard with one click. Download to a file is not built into this tool yet.

Why does my XML show unusual keys like @id?

Attributes are preserved so no data is lost. @id means the attribute id on that element. If you do not want attributes, strip them before pasting.

Why does it say my JSON is invalid?

Strict JSON does not allow single quotes, unquoted keys, trailing commas, or comments. The error table on this page lists the most common causes and how to fix each one.

Does it work offline?

Yes, after the first page load. No network requests are made while you paste, search, or run JSONPath queries.

Is it really free?

Yes. There is no account, no watermark, no daily limit, and no paid tier for this tool.

Need a different tool?

Tell us what you need. We add tools that people ask for.

Request a tool