How to compare two JSON files
A plain text diff of two JSON documents is misleading: reorder the keys or reformat the file and every line looks changed. A semantic JSON diff compares the data itself. This guide shows how to compare two JSON files or API responses and see only the real differences.
Compare two JSON files in three steps
- Open the JSON tool. Go to the JSON comparison workspace.
- Add both documents. Paste the original into Payload A and the new version into Payload B, or
drop
.jsonfiles onto each box. Invalid JSON is flagged straight away. - Read the result. The two documents are shown as aligned trees with changes highlighted. Click any changed line to see its JSONPath, both values and their types.
Options that make JSON diffs useful
- Ignore key order (on by default):
{"a":1,"b":2}and{"b":2,"a":1}are equal. - Ignore array order: treat arrays as sets when the order of items is not meaningful, such as a list of tags.
- Strict type checking: report
1500becoming"1500"as a type change. This catches a common source of API bugs. - Only changed lines: hide everything that matches.
Three ways to view the differences
- Side-by-side tree: both documents aligned key by key, with objects you can expand or collapse.
- JSONPath audit table: one row per change, for example
$.order.items[2].price, with the old value, new value, their types and the numeric difference. - RFC 6902 JSON Patch: the list of
add,removeandreplaceoperations that turn A into B. Copy it or download it aspatch.json.
The audit table can also be exported as CSV, as an Excel report or as a PDF report.
Typical uses
- Checking what changed between two versions of an API response.
- Comparing webhook payloads from a test and a live environment.
- Finding configuration drift in
package.json,tsconfig.jsonor app settings. - Reviewing a data fixture before committing it.
Frequently asked questions
Is it safe to paste API responses that contain tokens or personal data?
Yes. The comparison runs in your browser and nothing is sent to a server. That is the main difference from most online JSON diff sites.
Can I format or minify the JSON first?
Yes. Each box has Format and Minify buttons, and Format Both tidies the two documents at once.
Does it support GeoJSON?
Yes. GeoJSON is JSON, so .geojson files compare the same way.
Try it now: free, no sign-up, nothing uploaded