Compare two JSON objects or arrays and compute deep structural differences and changes.
Loading tool
About JSON diff
Compares two JSON documents structurally and lists every added, removed and changed value with its path (for example $.engines.node or $.maintainers[1].name). Key order and formatting are ignored, and type changes such as a number becoming a string are reported separately. Options let you ignore array order and compare strings case-insensitively; results can be filtered and copied as a plain-text report.
Common uses
- Compare API responses before and after a change
- Find what changed between two versions of a config file or package.json
- Check a snapshot test failure on a large JSON payload
- Verify that two serializers produce equivalent output
FAQ
- Does key order matter?
- No. Objects are compared by key, so {"a":1,"b":2} and {"b":2,"a":1} are equal. Whitespace and indentation are also ignored.
- How are arrays compared?
- By default, item by item at the same index. With 'Ignore array order', items are matched by value, so a reordered array shows no differences.
- Can I compare JSON with comments or trailing commas?
- No. Both inputs must be strict JSON as accepted by JSON.parse; parse errors are shown with the line and column when available.