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].skustraight into your code or a test assertion. - A type change (the string
"no"where there was a booleanfalse) 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.