JSON Diff / Comparator

Compares two JSON documents key by key and lists exactly what was added, removed and changed, with a dotted path to each difference. It is meant for the moment when two API responses should be identical and are not, and a text diff drowns you in reformatting noise.

Live demo · real result from this tool
Compare arrays
Differences5
Added
2
Removed
1
Changed
2
Unchanged values
4

Differences

~ version: "1.2.0" → "1.3.0"− port: 8080+ features[2]: "search"~ db.pool: 10 → 20+ cache: true

Detail

ChangePathOriginalChanged
changedversion"1.2.0""1.3.0"
removedport8080
addedfeatures[2]"search"
changeddb.pool1020
addedcachetrue

Processed on your device — nothing is uploaded.

How to use JSON Diff / Comparator

  1. Paste the original document into the left panel.
  2. Paste the version you are comparing against into the right panel.
  3. Read the added, removed and changed counts, then work down the list of paths — it updates as you edit either side.
  4. Both inputs must be valid JSON; a syntax error on either side stops the comparison rather than producing a partial result.
  5. A top-level array is compared as a single value, so wrap arrays in an object if you need per-key detail.
  6. Nothing is uploaded — both documents stay in the page, which matters when you are comparing production payloads.

Formatting and key order are invisible to it

Both sides are parsed before anything is compared, so indentation, line endings, trailing commas in your editor and the order the keys happen to appear in never show up as differences. That is the whole reason to use a structural diff: run two versions of the same API response through a text diff and you will spend most of your attention on lines that only moved. Here, if the data is the same, the result says so.

How nesting is handled — and how arrays are not

The comparison recurses into nested objects, so you get precise paths like user.address.city rather than a note that “user changed”. Arrays are treated as single values: change one element of a fifty-item list and you get one changed row showing both arrays in full, not an element-by-element diff. This is a deliberate limitation — diffing arrays properly means guessing whether an item was edited, inserted or moved, and guessing wrong is worse than not guessing. For array-heavy payloads, compare a single element at a time, or sort both sides by a stable key first.

Reading the output

A green + is a key present only in the second document, a red − is one present only in the first, and an amber ~ is a key in both whose value differs, printed as old → new. Keys that match are counted in the summary but left out of the list, so a long document with one change produces one line. A type change — the string “1” becoming the number 1 — shows as a change, which is usually the bug you were looking for.

What people use it for

Catching an API regression between staging and production. Finding configuration drift between two environments that are supposed to match. Confirming that a data migration touched only the fields it was meant to. Reviewing what a dependency update did to package.json or tsconfig.json. Checking that a refactor left a serialised payload unchanged.

Frequently asked questions

What types of differences are shown?
Added keys (green), removed keys (red), and changed values (yellow) are all highlighted.
Does it handle nested objects?
Yes — the diff is recursive and shows differences at any nesting level.
Can I compare JSON arrays?
Yes — array element differences are shown with index-based tracking.
Does the order of keys count as a difference?
No. JSON objects are unordered by definition, and the tool parses before comparing, so reordered keys produce no differences at all. Only added, removed and genuinely changed values are reported.
Why is my whole array reported as one change?
Because arrays are compared as complete values rather than element by element. It is an honest limitation: inferring whether an array item was edited, inserted or moved requires assumptions this tool does not make. Compare individual elements when you need that detail.
Can it compare more than two documents?
Not at once — it compares a pair. For three versions, diff A against B and then B against C; the two result sets together tell you what moved at each step.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close