JSON diff
See what really changed between two JSON documents, ignoring key order and whitespace, and export the result as a JSON Patch.
Comparing two JSON documents
Two API responses that look the same to a person can differ in key order, whitespace or the position of one field, and a plain text diff makes every one of those a change. A structural JSON diff parses both sides first and reports only what is different in meaning: values that changed, fields that appeared and fields that disappeared, each with its exact path.
Paste the old document on the left and the new one on the right. The result lists every difference with a coloured marker and a JSON Pointer path. A second view gives the same changes as an RFC 6902 JSON Patch, which you can apply with libraries such as Jackson's JsonPatch support, json-patch in Node, or the Python jsonpatch package. The tool applies the patch to the left side internally to prove that it produces the right side, so the patch it shows is one you can trust for index-based arrays.
Where it helps
- Checking what a refactoring changed in an API response, before and after.
- Finding the one differing field between two environments' configuration.
- Writing regression tests: keep the expected JSON and diff the actual one.
- Auditing: generate the patch between two versions of a stored document.
For arrays of records, switch on "match items by key" and enter a field such as id. Items are then paired by that field, so moving an item within the array does not look like a removal and an addition. Your data stays in the browser.
Frequently asked questions
How is this different from a text diff?
A text diff compares lines, so reordered keys or different indentation look like changes. A JSON diff compares the parsed structure: key order is ignored and only real differences in values, added fields and removed fields are reported.
What is a JSON Patch?
RFC 6902 describes a list of operations (add, remove, replace) that turn one JSON document into another, each addressed by a JSON Pointer such as /address/zip. The tool can output the diff in that format so you can apply it with a library.
How are arrays compared?
By position: item 0 against item 0, and so on, with extra items reported as added or removed. If your arrays hold objects with an id, enter that key and items are matched by it instead, which is a report rather than a patch.
Can I ignore fields like timestamps?
Yes. List JSON Pointers to ignore (for example /updatedAt) and they are skipped in the comparison.