How to use the JSON Compare
- Paste the original JSON on the left.
- Paste the new JSON on the right.
- Click Compare JSON.
- Review the list of differences by path.
Example
| Input | {"a":1,"b":2} vs {"a":1,"b":3,"c":4} |
|---|---|
| Result | b changed: 2 → 3 · c added: 4 |
How the comparison works
Paste the original JSON on the left and the new JSON on the right, then click Compare JSON. The tool compares the two structures rather than the text, so differences in whitespace, indentation and the order of keys are ignored. Each difference is listed with its path, such as $.stock.store, and a label of added, removed or changed.
Reading the results
- A summary at the top counts added, removed and changed values.
- Added: a key or array item exists only in the new JSON.
- Removed: it exists only in the original.
- Changed: the value differs, or the type is different, such as a number that became text.
- “$” stands for the root of the document, and array items are shown as [0], [1] and so on.
Ignore array order
By default array items are compared by position, so the same items in a different order show as changes. Tick “Ignore array order” when the order does not matter, such as a list of tags. Arrays are then compared as collections, and only items that appear in one array and not the other are reported.
When the JSON is invalid
If either side is not valid JSON, the tool says which one and shows the parser’s error message. Fix it with the JSON Formatter, whose Fix JSON button repairs common mistakes such as trailing commas and single quotes.
Good uses
- Comparing API responses before and after a change.
- Reviewing differences between two configuration files.
- Checking test fixtures or exported data.
- Verifying that two JSON files are equivalent even if they are formatted differently.
Frequently asked questions
Does key order matter?
No. Objects are compared by key, so {"a":1,"b":2} and {"b":2,"a":1} are equal.
How are arrays compared?
Arrays are compared item by item by position. Turn on “Ignore array order” to treat arrays as unordered lists of values.
Does the order of keys matter?
No. Keys are compared by name, not position, so reordering keys is not reported as a change.
Can I compare very large files?
Yes, within the 5 MB file limit for “Open file”. Very large documents may take longer on slower devices.