Search DevFox

Search tools and pages.

JSON Diff Visualizer

Compare two JSON documents with a structure-aware diff tree, ignore-order options, and JSON Patch (RFC 6902) plus jsondiffpatch delta export

Loading tool...

What is JSON Diff Visualizer

Written by Giorgos Kostas. Last reviewed:

JSON Diff Visualizer compares two JSON documents semantically — added, removed, changed, type-changed, and moved keys/items each get their own colour and badge in a hierarchical tree, instead of a line-by-line text diff.

Toggle 'ignore key order' to treat `{a:1,b:2}` and `{b:2,a:1}` as identical, or 'ignore array order' to detect that an item only moved (not changed). The right-hand panel exports the patch as RFC 6902 JSON Patch or as a jsondiffpatch delta.

Why use it

  • Stop fighting whitespace and key-order noise that line-based diff tools surface as false changes.
  • Generate an RFC 6902 patch you can apply with `fast-json-patch`, `rfc6902`, or any HTTP `PATCH` request.
  • See array moves as a single arrow instead of a delete + insert pair.
  • Compare two API responses to confirm a backend change didn't add/remove fields silently.
  • Audit a configuration migration by diffing the before/after JSON snapshots.

Features

  • Structure-aware diff tree with added / removed / changed / type-changed / moved badges
  • Ignore key order and ignore array order toggles for semantic comparison
  • RFC 6902 JSON Patch export, ready for fast-json-patch / rfc6902
  • jsondiffpatch delta export for round-trip use with the same library
  • Click any change in the summary to scroll the tree into view
  • Auto-expands ancestors of every change so you never have to hunt for diffs

How to use JSON Diff Visualizer

  1. Paste original JSON. Drop the old version into the left editor (file upload supported).
  2. Paste updated JSON. Drop the new version into the right editor; parse errors surface inline.
  3. Toggle ignore options. Enable 'ignore key order' and/or 'ignore array order' to remove cosmetic noise.
  4. Inspect the tree. Each changed key gets a colour-coded badge. Use 'Next change' to jump between deltas.
  5. Export the patch. Switch to JSON Patch tab to copy an RFC 6902 patch, or to the delta tab for jsondiffpatch format.

Example (before/after)

JSON Diff Visualizer input

Start with the jSON Diff Visualizer input you want to process in JSON Diff Visualizer.

JSON Diff Visualizer output

Get a jSON Diff Visualizer result from JSON Diff Visualizer that is ready to review, copy, and reuse in the next step of your workflow.

Common errors

Unsupported input

The tool may reject input that does not match the expected content, structure, or file type.

Fix: Confirm the tool input requirements and paste the correct type of data.

Incomplete values

Missing fields or partial content can block processing or produce weak results.

Fix: Provide the full required input before running the tool.

Copying placeholder content

Sample or placeholder values can lead to output that looks valid but is not ready for real use.

Fix: Replace placeholders with your actual values before relying on the result.

FAQ

How is this different from the existing Diff Checker?

Diff Checker is a line-by-line text diff (Myers / Patience) — fine for code, but it produces noisy output for JSON because reformatted whitespace and reordered keys all show as changes. JSON Diff Visualizer parses both sides and walks the resulting object tree, so the diff is on the data itself: a moved key inside an object is a 0-cost change, not five removed lines plus five added lines.

What does 'ignore array order' actually do?

Each array item is hashed by its `id`, `_id`, `uuid`, `key`, or `name` field if present, otherwise by primitive value. Items with the same hash are matched even if their indices differ — and the result includes a 'moved' edge that records the new index. Without this toggle, JSON Diff falls back to positional comparison.

Can I generate a patch I can apply with `fast-json-patch`?

Yes. The 'JSON Patch' tab outputs a strict RFC 6902 array of operations (`add`, `remove`, `replace`, `move`). You can paste that into any RFC 6902 implementation — `fast-json-patch`, `rfc6902`, JSON Patch in `jsonpatch-py`, or as an HTTP `PATCH` body.

Will it diff two huge JSON documents?

Comfortably up to a few MB per side. Both editors are Monaco with virtualization. The diff itself is O(n) over the data plus O(n log n) for array hashing; tens of thousands of nodes are usually fine, but pathological inputs (deeply nested + many moves) get slower.

Are my JSON documents sent to a server?

No. Parsing, diffing, and patch generation all happen in the browser — there is no server round-trip. The same applies to file uploads; the file is read with `FileReader` and never leaves your device.

Why are some 'unchanged' nodes still shown?

Unchanged nodes are hidden by default unless they're an ancestor of a change. Toggle 'Unchanged' in the toolbar to expose every key — useful when you want to view the structure of both documents side-by-side, not just the deltas.