JSON Diff

Paste two JSON documents and get a structural comparison: every added, removed or changed value, listed with its exact path. Key order and formatting differences are ignored.

json-diff · runs locally

What this JSON diff tool does

Comparing JSON with a text diff is noisy: reordered keys, changed indentation and trailing commas all light up as differences even when the data is identical. This tool compares structure instead. Both documents are parsed, then walked together; the output is a flat list of real differences — each one labeled added, removed or changed and addressed by its exact path, like $.config.timeout.

Everything runs in your browser, so comparing production API responses or config files containing secrets is safe.

How to compare two JSON documents

  1. Paste the original document on the left and the modified one on the right.
  2. Click Compare. Parse errors are reported per side.
  3. Scan the list: green additions, red removals, amber value changes with before → after.

Typical comparisons

Diff an API response between staging and production to spot a misconfigured field; compare a config file before and after a deploy; check what a migration script actually changed in a document store record. When array order is creating noise, run both documents through the JSON Sorter first so objects serialize consistently, then compare the normalized versions.

Frequently asked questions

Does key order matter in the comparison?

No. The diff is structural: documents are parsed first and compared as data, so key order, whitespace and formatting differences are invisible. Only actual values and structure count — which is exactly what a text diff of JSON gets wrong.

How are the difference paths written?

In JSONPath-like notation starting at $ for the root: $.user.email is the email key inside the user object, and $.items[2].price is the price of the third array element. Paths point at exactly where the difference lives.

How are arrays compared?

Position by position: index 0 against index 0, and so on. An element inserted at the front therefore reports every later index as changed — that is inherent to positional comparison. Sorting or keying arrays before comparing gives cleaner results when order is not meaningful.

What counts as 'changed' versus 'added' or 'removed'?

A key or index present on both sides with a different value is changed — including when the type changed, say from a string to an object. Present only on the right is added; present only on the left is removed.