JSON Diff
Compare two JSON files and list added, removed and changed values by path
Runs entirely in your browser. Nothing you type or upload is sent to us or stored.
Results are for general guidance. Please check anything important before relying on it. Terms of use
How to Use
- Paste the original JSON in the left box and the changed JSON in the right box, or tap Open .json file under each. Try a sample loads two versions of an order to play with.
- If either side isn't valid JSON, the error appears under that box with its line and column. Tap Show me to jump to the spot.
- Choose what to ignore with the switches: Ignore key order (on by default), Ignore array order, Ignore case in strings and Ignore extra spaces in strings.
- Read the summary (added, removed, changed) and the Changes list, where each difference has its path, like
items[1].qty, with the old and new values. Copy or download the list with the buttons on its title bar. - Scroll to Side by side to see both documents pretty-printed with the changed lines highlighted. Swap exchanges the two sides.
Compare two JSON files and see exactly what changed
This JSON diff tool compares two JSON documents by their structure, not just as text. Two API responses can look completely different line by line because the keys came back in a different order or one was minified, and still hold the same data. A plain text compare shows dozens of false differences. A structural compare parses both sides and reports only real changes: a value that was added, removed or changed, each with the exact path where it happened.
Reading the change list
Here's an example. The original has a customer in Ahmedabad on a basic plan; the new version moved to Gandhinagar, upgraded and picked up a tag:
Changed: {"name":"Asha","city":"Gandhinagar","plan":{"type":"pro","price":"499"},"tags":["new","vip"]}
~ city: "Ahmedabad" -> "Gandhinagar"
~ plan.type: "basic" -> "pro"
~ plan.price: 199 -> "499" (type changed)
+ tags[1]: "vip"
Paths use the same notation as JavaScript: a dot for an object key and square brackets for an array position, counted from 0. Keys with spaces or symbols are quoted, like ["first name"]. Note the third line. The price changed from the number 199 to the text "499". The tool marks this as a type change, because it's a classic source of bugs: code that does price + 18 suddenly produces "49918".
The ignore options
| Option | When it's on | Use it when |
|---|---|---|
| Ignore key order | {"a":1,"b":2} equals {"b":2,"a":1} | Almost always. JSON objects are unordered by definition (RFC 8259). Turn it off to also list objects whose keys were reordered. |
| Ignore array order | [1,2,3] equals [3,1,2] | The array is really a set, like tags, roles or permission lists |
| Ignore case in strings | "Pune" equals "PUNE" | Comparing data typed by people, such as city names |
| Ignore extra spaces in strings | "New Delhi " equals "New Delhi" | Data copied from spreadsheets or forms |
The string options apply to values, not to key names.
How arrays are matched
When order matters, the tool first lines up array items that are identical on both sides, the way a text diff lines up unchanged lines. So if one item is inserted at the start of a list of 50 orders, you see one addition at [0], not 50 changes. Items left over between two matches are compared field by field, so a changed quantity inside an order shows as items[1].qty rather than as a whole removed and added order.
Where a JSON compare helps
- Checking what a new version of an API returns before you release it
- Comparing config files (package.json, appsettings.json, Firebase rules) between two environments
- Finding what changed between two exports of the same data
- Reviewing test fixtures and snapshot files
Both documents stay in your browser. Nothing is uploaded, so you can compare responses that contain customer data or API keys. For plain text, CSV or code that isn't JSON, use the text compare tool instead.