JSON Diff

Compare two JSON documents and list every added, removed and changed key with its full path, optionally ignoring array order.

Differences (3)
Differences (3)

+ added · − removed · ~ changed · Click a value to copy it.

~ roles[1]: →
~ age: →
+ active =

What this JSON diff does

Paste an original document into box A and an updated one into box B, and this tool walks both structures recursively to list exactly what changed. Every difference is reported as one of three types: added (a key or array element that exists only in B), removed (only in A), or changed (present in both but with a different value). Each entry shows the path to the value, using dot notation for object keys and bracket notation for array indices, so a nested change reads like user.roles[0]. Comparison is deep and value-aware, meaning two documents with the same content in a different key order still count as identical.

How paths and comparison work

The two text boxes are parsed as JSON and compared live as you type, so there is no button to press. Objects are matched by key and arrays by index by default; tick Ignore array order and two arrays holding the same values in any order count as equal. When a value's type flips — for example an object becoming a number — that whole value is reported as a single changed entry rather than a flood of sub-differences. Primitive values are compared strictly, and null is treated as its own value, so changing null to 0 is a real change. If either box contains invalid JSON, an inline message points out which side needs fixing; once both parse, you can copy the full difference list to your clipboard.

Frequently asked questions

How are the paths formatted?

Object keys use dot notation and array elements use bracket indices, combined for nested data — for example user.roles[0] means the first element of the roles array inside the user object. A change at the very top level shows as (root).

Does key order or whitespace affect the result?

No. The documents are parsed first, so formatting, indentation, and the order of keys in an object are ignored. Only real differences in keys and values are reported; array order matters by default because arrays are compared by index, but tick Ignore array order and two arrays holding the same values in any order are treated as equal.

Does it accept JSON with comments, and can I see the changes in place?

Yes. Both boxes also read the relaxed form config files use — comments, trailing commas, unquoted keys — and say when they did. A switch shows the whole second document with each added, removed or changed line marked, instead of only the list of changes.

Can I copy just one value out of the list of differences?

Yes. In the list of differences each value is a button: click it and only that value goes to the clipboard — a string as its bare text, without the quotes, and a number, object or array as the JSON it is. The legend above the list adds “Click a value to copy it.” The Copy button copies the whole list. Clicking a value works in the list view; with Show the whole document ticked, the page shows the marked document instead.