Compare two JSON documents
Paste two JSON values to see exactly what was added, removed or changed, listed by path such as user.address.city or items[2].price. The comparison works on the data rather than the text, so indentation, line breaks and key order make no difference. Both documents stay in your browser.
Reading the results
- Added means the value exists only in the right-hand document.
- Removed means it exists only in the left-hand one.
- Changed means both have it but the values differ. A change of type counts too: 1 and "1" are different, which is a common source of API bugs.
Paths use dots for object keys and [n] for array positions. When arrays are compared without regard to order, unmatched items are shown with an empty [] because they no longer have a fixed position. Copy report gives you the list as plain text, with + for added, - for removed and ~ for changed, ready to paste into a ticket or pull request.
The three options
- Ignore array order matches array items wherever they are. Use it for lists where order means nothing, such as tags, roles or permission sets. Items have to be identical to match, so an item that changed shows up as one removed and one added.
- Treat missing key and null as equal hides a common source of noise: one service leaves a field out, another sends it as null.
- Case-insensitive string comparison treats Active and active as the same value.
Why not use a text diff?
A line-by-line diff reports a change whenever keys are reordered or a file is re-indented, and different languages and libraries serialize JSON differently. You end up reading pages of differences that are not differences. Comparing the parsed data shows only real changes. A text diff is still the better choice when you care about formatting or the exact bytes of a file.
Typical uses
- An API response before and after a deploy, to catch a field that was renamed or changed type.
- Configuration for staging and production, to find the setting that differs.
- A test fixture against real output, when a test fails on a large object.
- Data before and after a migration or an import.
Two limits
Integers larger than 9,007,199,254,740,991 are rounded when JSON is read in a browser, so two long IDs that differ only in their last digits can be reported as equal. Keep long IDs as strings. Very large documents are limited by your device's memory; files of a few megabytes compare almost instantly.