How to compare JSON
- Paste the original JSON on the left and the changed JSON on the right, or drop a file onto each side.
- Read the summary and the list of differences: every added, removed or changed value is shown with its path, for example
$.users[2].email. - Scroll down to the side-by-side view to see the changes in context. Tick Ignore array order if the order of list items does not matter.
A semantic JSON diff instead of a text diff
A plain text diff reports a change whenever a key moves, the indentation differs or a number is written differently. This JSON diff compares the data itself:
- Key order is ignored –
{"a":1,"b":2}equals{"b":2,"a":1}. - Formatting is ignored – spaces, line breaks and indentation make no difference.
- Numbers are compared by value –
1.0equals1. - Arrays are aligned – inserting one item does not mark every following item as changed, and modified objects are matched with their most similar counterpart.
- Ignore array order – compares arrays as unordered collections, useful for lists of tags, IDs or permissions.
Reading the results
| Label | Meaning | The path points to |
|---|---|---|
| Added | The value exists only in the changed JSON | its position in the changed JSON |
| Removed | The value exists only in the original JSON | its position in the original JSON |
| Changed | Both documents have the key, with a different value or type | its position in the changed JSON |
In the side-by-side view both documents are formatted with sorted keys so that matching lines face each other; long unchanged stretches are folded unless you untick Hide unchanged lines.
Frequently asked questions
Does the order of keys matter?
No. JSON objects are unordered by definition, so the comparison ignores key order. Arrays are ordered, unless you tick Ignore array order.
Can I compare large JSON files?
Yes. The comparison runs in your browser and lists the first 200 differences, with a button to show them all; the side-by-side view shows up to 5,000 lines.
How do I compare JSON in code?
In Python, json.loads(a) == json.loads(b) tests equality. JavaScript has no built-in deep comparison; libraries such as Lodash offer _.isEqual(a, b). On the command line, diff <(jq -S . a.json) <(jq -S . b.json) shows the differing lines.
Is my data uploaded?
No. Both documents are compared locally in your browser and never leave your device.