JSON Compare

Paste two JSON documents. You get every difference listed by its path — added, removed, changed, type changed — and a side-by-side diff that ignores key order and formatting.

Original

Changed

No identifying key found in arrays — matched by position

+0 added−0 removed~0 changed0 unchanged

Why a plain text diff is not enough for JSON

Two JSON documents can hold identical data and still look completely different: keys in another order, different indentation, everything on one line. A line-based diff reports all of that as changes. This tool parses both sides first, so it compares data, not text:

  • Ignore key order (on by default) sorts every object’s keys before diffing, because JSON objects are unordered (RFC 8259).
  • Both sides are re-indented identically, so formatting never shows up as a difference.
  • The path table lists each change in JavaScript notation — paste items[2].sku straight into your code or a test assertion.
  • A type change (the string "no" where there was a boolean false) is flagged separately, because it breaks consumers even when the value looks similar.

Match array items controls how lists are paired. With by key (auto-detect), arrays of objects that share a unique identifier (id, _id, uuid, key, sku, name…) are matched on it, so a reordered or inserted item is reported once as items[sku="SCARF"] instead of shifting every index. Choose by key… to name the field yourself, or by position to compare index by index.

Questions

Does JSON compare ignore the order of keys?

Yes, by default. Untick Ignore key order if order matters to you (for example when diffing a file for a code review).

Can I compare two JSON files?

Yes — drop a file onto either side or use Open file. Nothing is uploaded.

Does it ignore array order too?

For arrays of objects with an identifying key (such as id), yes — items are matched by that key, auto-detected by default. Arrays of plain values are compared by position, because order is meaningful in JSON.

What if one side is invalid?

You get the exact line and reason for the error. Fix it with the JSON repair tool, then compare again.

Related tools