JSON Diff
Compare two JSON documents and list every structural difference
About JSON Diff
Lists every added, removed, changed or type-changed value between two JSON documents, with its JSONPath, the old and new values and a count per kind, and copies the diff as JSON or as an RFC 6902 JSON Patch. Objects are matched by key in any order, but arrays are compared by index, so one inserted item shifts the rest. Useful for checking API responses, config edits and test fixtures.
Category: Text.
Frequently asked questions
How are arrays compared?
▾
By index: item 0 is compared with item 0, item 1 with item 1, and extra items at the end are reported as added or removed. Items are not matched by content, so inserting one near the start reports every later position as changed.
Do key order, whitespace or number formatting matter?
▾
No. Both sides are parsed in your browser with JSON.parse, so indentation and key order are ignored, and 1, 1.0 and 1e0 count as the same number. Parsing also means integers beyond 2^53 lose precision and only the last value of a duplicate key is compared.
Is a null value the same as a missing key?
▾
No. A key set to null on one side and absent on the other is reported as removed or added, and replacing null with any other value, such as 0 or an object, is reported as a type change.
What do the copy buttons produce?
▾
Copy JSON gives an array of change objects with kind, path and the old and new values. Copy JSON Patch gives RFC 6902 add, remove and replace operations with JSON Pointer paths that turn the left document into the right one, ready for a library such as fast-json-patch.