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.
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
Step 1
Paste JSON or XML
Drop in a document, or load one of the samples to see how it works.
Step 2
Explore and search
Expand nodes, search keys or values, and inspect the shape of the data.
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.
{
"orders": [
{ "id": 101, "customer": { "email": "ana@example.com" }, "total": 49.5 },
{ "id": 102, "customer": { "email": "raj@example.com" }, "total": 12 }
]
}| Query | What it selects | Result |
|---|---|---|
$.orders[*].id | The id of every order | [101, 102] |
$..email | Every email at any depth | ["ana@example.com", "raj@example.com"] |
$.orders[0].customer | The customer object of the first order | { "email": "ana@example.com" } |
$.orders[-1].total | The total of the last order | 12 |
JSONPath cheat sheet
These are the JSONPath features this tool evaluates. Use bracket notation for keys that contain spaces, dashes, or other special characters.
| Syntax | What it does | Example | Supported |
|---|---|---|---|
$ | The root of the document | $ | Yes |
.key | A child key | $.user.name | Yes |
['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 | $..name | Yes |
[?(@.price > 10)] | Filter expression | Not available | No |
[0:3] | Array slice | Not available | No |
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.
<order id="101">
<item sku="A1">Pen</item>
<item sku="B2">Ink</item>
</order>{
"order": {
"@id": "101",
"item": [
{ "@sku": "A1", "#text": "Pen" },
{ "@sku": "B2", "#text": "Ink" }
]
}
}| XML construct | In the tree | Example |
|---|---|---|
| Element with child elements | An object with one key per child | order > item |
| Attribute | A key prefixed with @ | @id, @sku |
| Text next to attributes or children | Stored under #text | #text |
| Repeated sibling elements with the same tag | An array | item: [ ... , ... ] |
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.
| What matters | Typical tools | ToolDeck |
|---|---|---|
| Works offline | No | Yes, after first load |
| Sign-up required | Usually | No |
| File upload | Yes, to a server | Never, runs in your browser |
| Watermark | Common on free plans | Never |
| Daily usage limit | Common | None |
| Cost | Credits or subscription | Free, unlimited |
| Search keys and values | Sometimes | Yes |
| JSONPath queries | Sometimes | Yes |
| XML support in the same tool | Often a separate tool | Yes |
Which ToolDeck tool should you use?
| If you want to | Use | Why |
|---|---|---|
| Explore nested data, search it, or run JSONPath | JSON and XML Tree Viewer (this page) | Read only tree with search and queries, for JSON and XML. |
| Pretty print, validate, minify, or edit JSON | JSON Formatter | Works on the text itself, so you can fix and reformat it. |
| See what changed between two payloads | Diff Checker | Side by side comparison of two blocks of text or code. |
| Get sample data for a UI or API test | JSON Mock Data Generator | Generates realistic JSON from a schema. |
| Verify a value or compare checksums | Hash Generator | Creates 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.
| Typical error | Likely cause | How to fix it |
|---|---|---|
| Unexpected token ' or single quotes | Single quotes around keys or strings | Use double quotes everywhere. |
| Unexpected token } or ] | A trailing comma after the last item | Remove the comma before the closing bracket. |
| Expected property name | A key without quotes | Wrap every key in double quotes. |
| Unexpected end of JSON input | The paste was cut off or a bracket is missing | Copy 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 string | A raw line break or tab inside a string | Escape it as \n or \t. |
| Unexpected token < at position 0 | You pasted HTML, for example an error page | Check 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.
Related developer tools
JSON Formatter
Pretty print, validate, and minify JSON.
JSON AI Fixer
Repair broken JSON from LLMs and remove markdown.
JSON to Code
Convert JSON into TypeScript, Go, or Rust models.
JSON Mock Data Generator
Generate realistic mock JSON from a schema.
Diff Checker
Compare two blocks of text or code.
Hash Generator
Generate MD5, SHA-1, and SHA-256 hashes.
Regex Tester
Test and debug regular expressions instantly.
Fake User Generator
Generate fake usernames and secure passwords for testing.
More free ToolDeck tools
Image Upscaler
Enlarge photos 2x to 16x with AI, right in your browser.
Video Upscaler
Upscale video resolution, for example 720p to 4K.
Anime Video Upscaler
Upscale anime to 1080p or 4K using the Anime4K engine.
Uppercase to Lowercase
Instantly convert capital letters to lowercase.
PDF Editor
Edit PDF files privately in your browser.
Image to Text (OCR)
Extract editable text from any image or screenshot.
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.