How the JSON comparison works
Both inputs are parsed and compared value by value. Every difference is listed with its path, for example $.address.zip or $.roles[1].
- Added: the key or array item is only in the changed JSON.
- Removed: it is only in the original.
- Changed: it is in both, with a different value or type.
Object key order and formatting are ignored, because they do not change the data. Arrays are compared by position unless you tick Ignore array order, which treats every array, including nested ones, as an unordered list.
When to use a JSON diff
- Checking what changed between two API responses or config files.
- Reviewing test snapshots and fixtures.
- Debugging why two environments behave differently.
To tidy JSON before comparing it, use the JSON formatter.