JSON comparator (structured diff)

Compare two JSON structures and pinpoint exactly what was added, removed, or changed.

Example:

How it works

A common use case for developers: two versions of an API response (for example before and after a migration, or between staging/production environments) need to be compared to pinpoint exactly which fields changed. Paste the first response into "JSON A" and the second into "JSON B", click "Compare": every difference is listed with its exact path (for example user.address.city) and shown in green for an addition, red for a removal, and yellow for a changed value.

How are arrays compared?

Arrays are compared element by element based on their position (index): the first element of A is compared with the first element of B, and so on. If an array is longer in one of the two documents, the extra elements appear as "added" or "removed" with their index in brackets, for example items[2]. Note: if elements are simply reordered rather than added or changed, this tool will flag them as changes at each affected position, since it doesn't attempt to intelligently realign arrays.

What happens if a field changes type?

If a key holds a number in one document and a string (or an object) in the other, the tool flags it directly as "changed" rather than trying to compare their internal content — a type change is generally a sign of a significant change in the data contract that deserves to be visible immediately.

The comparison runs 100% locally in your browser via WebAssembly: your JSON data, even sensitive, is never transmitted to a server.