JSON Viewer

Explore JSON as a collapsible tree, search it and copy the path to any value.

JSON Viewer tool

Path of the selected node
Selected value

About the JSON Viewer

Large API responses and configuration files are much easier to understand as a tree than as thousands of lines of text. This JSON viewer turns any JSON into collapsible branches with item counts, lets you search keys and values and copies the exact path of any node, such as data.orders[3].total, for use in code. Open a file or paste text; nothing is uploaded.

Click any key or value to see its full path, ready to paste into your code. Choose JavaScript notation such as data.users[0].email, JSONPath such as $.users[0].email, or a jq filter such as .users[0].email. Keys with spaces or symbols are quoted correctly in every style, which saves time and mistakes when you dig through deeply nested responses.

The search box finds keys and values anywhere in the document, opens the branches that contain them and highlights each match, with a count of the results. Expand all and Collapse all switch between the overview and the detail, and large files stay responsive because branches are only built when you open them. If the JSON is invalid, the viewer points to the line and column of the problem.

Everything runs in your browser and nothing is uploaded. To reformat or repair JSON, use the JSON formatter; to compare two versions, the JSON diff checker; and to turn JSON into a spreadsheet, the JSON to CSV converter.

How to use the JSON Viewer

  1. Paste or open JSONPaste JSON into the box or open a .json file; the tree appears at once.
  2. Explore the treeUse the arrows to open branches, or Expand all and Collapse all.
  3. SearchType part of a key or value to highlight every match and open its branches.
  4. Copy a pathClick a key or value, pick a path style and copy the path or the value.

JSON Viewer features

  • Collapsible tree for objects and arrays
  • Key and item counts on every branch
  • Color-coded strings, numbers, booleans and null
  • Search keys and values with highlighting
  • Paths in JavaScript, JSONPath or jq style
  • Expand all and collapse all
  • Line and column of JSON errors
  • Fast on large files; nothing is uploaded

Common uses

  • Exploring API responses while building an integration
  • Finding the path to a value for code or a jq filter
  • Reviewing configuration files and package manifests
  • Debugging webhook payloads
  • Teaching how JSON structures nest

Exploring JSON in practice: debugging an app's prices, learning an unfamiliar API, missing fields, lock files and structured logs

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

A tree view turns a wall of JSON into something you can explore, which is often the quickest way to answer questions such as why an app shows the wrong value or what an unfamiliar API actually returns. This guide works through debugging a price display, then covers learning a new API's structure, finding fields that are sometimes missing, writing safe access code, and using the viewer with configuration files, lock files and logs.

A worked example: a price that shows wrongly

A shopping app shows Rs NaN for some products. Pasting the product API response into the viewer and searching for price reveals two fields: price, shown in the number colour, and sale_price, shown in the string colour with the value 1,250. The sale price arrives as text containing a comma, which the app cannot treat as a number. The fix belongs in the API, which should send numbers as numbers, with a defensive conversion in the app until then.

Learning an unfamiliar API

When starting with a new API, collapse everything and expand one level at a time. The top level usually reveals the pattern: a data array, a meta object with totals, and links for pagination. The item count beside each branch shows how many records arrived, often 20 or 50 per page, which tells you that more requests are needed to fetch everything.

Fields that are sometimes missing

Compare several items in an array rather than just the first. Optional fields, such as a discount or a second address line, may appear on some records and be absent or null on others. Code written from the first record alone breaks on the first item without the field. Searching for a key and checking the match count against the number of items shows quickly whether a field is always present.

From viewer to code

Copying a path such as data.products[3].variants[1].price gives the exact route to a value. In JavaScript, writing it with optional chaining, as data.products?.[3]?.variants?.[1]?.price, returns undefined instead of crashing when any step is missing. Combined with a sensible default, this keeps an interface working when an API returns less than expected.

Configuration and lock files

Package lock files and large configuration files are JSON documents that are hard to read in a text editor. Searching a lock file for a library's name shows every version installed and which packages depend on them, which helps explain why an old version keeps appearing in security reports.

Structured logs

Many applications write logs as one JSON object per line. The viewer works with one document at a time, so copy a single line to examine it. Expanding the request, user and error fields of a failing entry often reveals the cause faster than reading the raw line.

Sharing safely

Before pasting JSON into a ticket, chat or document, remove access tokens, passwords, phone numbers and other personal data. API responses often contain more personal information than expected, such as customer addresses inside order data.

Common mistakes

  • Designing code from the first array item only.
  • Ignoring that a value is a string when it looks like a number.
  • Fetching only the first page of a paginated API.
  • Sharing responses that contain tokens or personal data.

Related tools

To order keys alphabetically before comparing, use JSON Sorter. To generate types from a response, try JSON to TypeScript, and to embed JSON inside a string safely, JSON Escape.

Reading error responses

APIs often return detailed error objects, with a code, a message and nested details such as validation errors for each field. Expanding these in the viewer shows exactly which field failed and why, for example a phone number that must contain 11 digits. Showing the right message beside the right form field then becomes straightforward.

Dates and timestamps

Responses contain times in several forms, such as Unix timestamps like 1792939560 or text such as 2026-10-25T14:46:00Z. Converting a few with the Timestamp Converter confirms whether they are in seconds or milliseconds and in UTC or local time, which prevents displaying times five hours off for visitors in Pakistan.

Spotting over-fetching

Item counts and expanded records reveal when an API sends far more than an app needs, such as hundreds of products with full descriptions when a list shows only twenty names and prices. Heavy responses slow apps on mobile connections. Asking for pagination or a lighter version of the endpoint can make screens load much faster.

JSON inside a string

Sometimes a field contains JSON written as a string, full of escaped quotes, which is common in logs, message queues and webhooks. The viewer shows it as one long string value. Copying that value, unescaping it and pasting it in on its own reveals its structure as a proper tree.

Privacy

Documents are parsed and displayed in your browser. Nothing you paste or open is uploaded or stored.

Further reading: JSON for Beginners: Syntax, Common Errors and Formatting.

Frequently asked questions

What is a JSON viewer?

A tool that displays JSON as a structured tree instead of plain text. Objects and arrays become branches you can open and close, which makes large or deeply nested documents much easier to read than a wall of brackets.

How do I get the path to a value?

Click the key or the value in the tree. The path appears below the tree in the style you choose, JavaScript, JSONPath or jq, with a copy button. Array positions are shown as numbers in brackets, counted from zero.

What is the difference between JSONPath and jq paths?

JSONPath starts with a dollar sign and is used by many testing tools, databases and API platforms, while jq paths start with a dot and work directly as filters for the jq command-line tool. Both describe the same location in the document.

Can I open large JSON files?

Yes. Files of many megabytes work, because branches are only drawn when they are opened. Expand all opens everything for normal files and stops after a few levels for very large ones, to keep the page responsive.

Why does it say my JSON is invalid?

JSON is strict: keys need double quotes, strings cannot use single quotes, and trailing commas and comments are not allowed. The message shows the line and column where the parser stopped, which is usually at or just after the mistake.

Does the viewer change my JSON?

No. It only reads the text and draws the tree, and your input stays exactly as you pasted it. As in JavaScript, numbers with more than about 15 significant digits are shown rounded in the tree.

Is my JSON uploaded?

No. The JSON is parsed and displayed by code running in this page, on your own device. Nothing is sent to a server or stored, so you can safely inspect private API responses and configuration files.