JSON Formatter, Diff and Tree Viewer: Compare and Explore Payloads

JSON Formatter, Diff and Tree Viewer: Compare and Explore Payloads

Format, diff two API responses and explore deep JSON in a tree — a no-install debug workflow in your browser.

02.08.2026
9 min read
Share this article:
JSONFormatterDiffTree viewerDebuggingTutorial

Three complementary tools for JSON debugging

Once the syntax is valid, the real work begins. You read a minified payload, spot what changed between two API versions or navigate a config nested over thousands of lines. The online JSON formatter re-indents a compact document with 2 or 4 spaces or with tabs, and pasting formats it right away. JSON diff compares two documents side by side and lists the changed, added and removed paths. The JSON tree viewer collapses deep branches, highlights search matches and spares you endless lines. These three tools on the JSON tools hub run entirely in your browser, and nothing is uploaded. If the JSON is invalid, start with the validate and repair JSON guide before formatting or comparing.

Re-indent without changing the values of the parsed JSON
Structural diff with JSON paths and keys-only mode for schema drift
Collapsible tree with search on keys and values
Full workflow: validate → format → explore → compare → minify
Runs in your browser, so API payloads, configs and secrets stay on your machine

Best practices and honest limits

Recommended order in the workflow

Formatting or comparing invalid JSON produces frustrating errors. Follow the order: validate (and repair if needed) → format or explore → diff → minify for prod.

Do not rely on the formatter to fix syntax: it parses strictly
Diff compares parsed structure, not raw line-by-line text
The tree viewer is read-only, with no inline editing
For versioned fixtures, sort the keys before committing so that Git diffs show only real changes
Document the workflow in your team: validator → formatter → diff on PR review
Limits to know

Each tool has a narrow scope. None of them is a full IDE, and the diff does not merge documents.

Diff: array order matters, so a moved item counts as a change
Diff: no direct YAML or XML comparison, so convert to JSON first
Tree viewer: very large files may slow mobile browsers
Formatter: no minification here, minify-json reduces the size
Escape/unescape: strings only, not entire JSON documents

When to use the formatter, the diff or the tree

Format JSON to review it

The JSON formatter parses the input, checks that it is valid, then writes it back with JSON.stringify and your indentation. The values stay the same, but the text is rewritten: 89.0 becomes 89, 1e3 becomes 1000 and \u escapes become plain characters. Integer-like keys move to the top of their object. Integers beyond 2^53 are rounded, and a duplicated key keeps only its last value.

2-space, 4-space or tab indentation to match your style guide
Optional key sorting (off by default) for stable diffs between commits
Invalid input → error message; fix first or use json-repair
Complement to the minifier: formatter = readability, minify-json = payload size
Same Monaco editor as the JSON validator
Compare two versions with JSON Diff

JSON diff needs two valid documents. It compares the parsed data, so indentation and key order do not count. It flags changed values, added or removed keys and type changes, each with a dotted path such as user.role.

Arrays are aligned item by item: a moved item shows as one removal plus one addition
Compare keys only: value edits are ignored, which helps when you check a schema's shape
Summary of affected paths, where a change inside an array is listed under the array's path
Both panels must parse before Compare runs, so validate or repair first
For free text (not JSON), use the text diff on the utilities hub
Explore JSON in a tree, without an IDE

The JSON tree viewer builds an interactive tree once the JSON parses. When it appears, two levels of keys are visible and deeper objects and arrays are collapsed. Search matches keys and values, ignores case and hides the branches that do not match. Expand and Collapse open or close every branch at once.

Read-only tree: edit the JSON in the input pane and the tree rebuilds once it is valid
Useful for unknown API responses during an integration or for bulky config exports
Every open node is drawn on the page, so a document of several MB can slow the browser, especially on a phone
Chain with json-diff after locating the suspicious branch
Complements json-formatter: format for line reading, tree for depth navigation
Escape and unescape strings

When your JSON contains multiline strings, quotes or sequences copied from devtools, use the JSON escape tool before formatting or exploring. Its Escape and Unescape tabs prepare or restore string literals with the native JSON.stringify and JSON.parse.

Escape: plain text → escaped content for a JSON string value
Unescape: \n and \" sequences become readable text again
Optional forward-slash escaping for embedding in HTML script tags
Runs locally. Pasting converts the text, typing does not: select Escape or Unescape after an edit

Format, explore, then compare

An unreadable minified API response

You copy a 200 response from the Network panel of the devtools. It is a single line of several KB.

1

Step 1: Validate (if unsure)

Paste it into the JSON validator. If it reports a syntax error, read the repair guide before going further.

2

Step 2: Format

Open the JSON formatter and paste the response. Pasting formats it, and setting Indent to 2 or 4 spaces formats it again. The parsed data does not change.

3

Step 3: Explore in tree (optional)

For a deeply nested object, paste the same output into the JSON tree viewer. Collapse the branches you do not need and search for a specific key.

A regression between staging and production

Two config or API response snapshots must be compared before deployment.

1

Step 1: Normalize (optional)

JSON diff ignores indentation and key order, so you can paste both documents as they are. Sort the keys in the formatter only if you also want a short line diff in Git.

2

Step 2: Compare

Paste the original on the left and the new version on the right in JSON diff, then select Compare. The summary lists each affected path.

3

Step 3: Drill into the delta

Suspicious path? Copy the branch into the tree viewer or reformat only that section for team review.

More on the JSON hub

These tools fit into a broader pipeline on the JSON tools hub.

json-formatter: beautify with configurable indentation and optional key sort
json-diff: structural comparison, keys-only mode for schema drift
json-tree-viewer: collapsible tree, search, expand all / collapse all
json-escape: prepare or restore escaped strings before integration
json-validator + json-repair: always upstream when syntax is doubtful
minify-json: compact the final payload before it goes to production

Conclusion

Debugging JSON should not require installing an extension or uploading sensitive payloads to a third-party server. Format to read, explore in a tree to navigate and compare to catch regressions, all locally on FastMinify. Add validation and minification when you are ready to ship.

Always validate syntax before formatting or comparing
Use diff in keys-only mode to verify schema shape
The tree viewer suits nested configs, not editing
Sort keys and normalize indentation before a line-by-line review in Git
See the validate/repair JSON guide for broken payloads
Share this article
Share this article: