b2KIT

JSON Tree Viewer

Visualize JSON data as a collapsible tree with syntax highlighting and search.

How to Use JSON Tree Viewer

  1. 1

    Paste your JSON

    Enter the JSON data you want to explore as a tree.

  2. 2

    Navigate the tree

    Click arrows to expand or collapse nested objects and arrays.

  3. 3

    Copy node paths

    Click a node to copy its JSON path for use in code.

Tested tool guide Tested browser tools Checked August 16, 2026

What JSON Tree Viewer does, with a checked example

This tool turns a JSON document into an expandable tree: paste the text or load a file, and every object, array, string, number, boolean, and null becomes a node you can collapse or expand, color-coded by type, with counts on every array and object. A search box finds matching keys and values and steps through the hits. The surprise for most users is strictness: the input must be valid JSON as defined by RFC 8259. Trailing commas, JavaScript-style comments, single-quoted strings, and unquoted keys are all rejected with a parse error. The tree is for reading structure, not reformatting - nothing is pretty-printed back out.

Worked example

A concrete input and expected output from the current implementation.

Input

{"name":"Ada","roles":["math","code"],"meta":{"active":true,"score":41.5}}

Expected output

{ } (3 keys)
  name: "Ada"         string
  roles (2 items)
    0: "math"         string
    1: "code"         string
  meta (2 keys)
    active: true      boolean
    score: 41.5       number

The tree mirrors the document's structure: the root object lists its three keys, arrays and objects show their size until expanded, and every scalar carries its JSON type. Each count and type shown follows directly from the input - two array items, two object keys, one boolean, one number.

How the result is produced

1

Parsing and validation

Before anything renders, the pasted text is parsed as strict JSON. Anything outside the grammar - trailing commas, comments, single quotes, unquoted keys, NaN, Infinity - stops the parse with an error pointing at the offending position, and no tree is built. The tree is constructed from the parsed values, so the input's own formatting (indentation, line breaks, spacing) has no effect on the structure shown.

2

Navigation and search

Each node collapses or expands independently, and global controls fold or flatten the entire document at once. Large arrays and objects render as collapsed entries showing their element or key count until opened, so a 10,000-item response is not expanded by default. Search scans keys and values, highlights every match, and shows a position counter so you can step through hits without manually expanding the path to each one.

Good uses

  • An API or webhook returned a large JSON body and you need to find where a specific field lives and what type it has - the tree shows the path and value without reading raw braces.
  • You are debugging a config file or log line and want to confirm a value is present and correctly typed, such as a timestamp stored as a string rather than a number.
  • Before writing code against a third-party API, you inspect a sample response to learn the document's shape - which keys are optional, which are objects, which are arrays - so your paths and validation match reality.

Limits and checks

  • Near-JSON fails: text that is valid JavaScript but not valid JSON - comments, trailing commas, single-quoted strings - is rejected with a parse error even though it looks fine in a console or config file.
  • Duplicate keys are invisible: if the document contains the same key twice, parsing succeeds (most parsers keep the last value) and the tree shows one entry, so the ambiguity is never reported.
  • Big numbers may round: integers beyond 2^53 cannot be stored exactly as double-precision floats, so a value pasted as 9007199254740993 may display as 9007199254740992. If exact digits matter, keep such values as strings in the source document.

Common questions

Is my JSON uploaded anywhere?

No. Parsing, tree-building, highlighting, and search all happen inside your browser, and nothing is sent to a server. This makes the tool a safe place to inspect API responses that contain tokens or personal data. The same browser-only constraint is why very large documents can render slowly - the work is done on your machine.

Why does my paste fail when it is valid JavaScript?

JavaScript object literals are a superset of JSON: they allow single-quoted strings, trailing commas, comments, and unquoted keys, and JSON allows none of these. If your text came from a console log, a config file, or a code snippet rather than a strict JSON source, that is the likely cause. Remove the extras and the parse will succeed.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools