JSON Diff — Compare JSON Online
Compare two JSON documents structurally and see every added, removed and changed value by its exact path.
Differences
Paste JSON into both panels to compare them.
How to use the JSON Diff
- Paste the original JSON on the left and the new JSON on the right.
- The diff updates as you type. Invalid JSON is flagged with the parser error.
- Turn on “Ignore array order” when arrays are sets, for example tags or IDs.
- Copy the change report or download it as text.
What is a JSON diff?
A JSON diff compares two JSON documents by their structure and values rather than line by line. A plain text diff reports a change whenever whitespace, indentation or key order differs, even if the data is identical. A structural JSON diff parses both documents first, walks every object and array, and reports only real differences: values that were added, removed or changed.
Each difference is labelled with its location as a JSONPath-style expression such as $.data.carrier.name or $.items[3].price. That makes the report easy to act on: you can jump straight to the field in your code, write a targeted test assertion, or paste the path into a bug report.
When developers compare JSON
- API regression testing — compare a response from staging with production, or before and after a deploy, to catch renamed fields and type changes.
- Configuration drift — compare
package.json,tsconfig.json, feature-flag payloads or infrastructure exports between environments. - Snapshot test failures — when a snapshot test fails, a path-level report shows exactly which values moved.
- Webhook debugging — compare the payload you expected with the one a provider actually sent.
How differences are detected
Objects are compared key by key, and key order is ignored because JSON objects are unordered by definition. Arrays are compared position by position, because order is part of an array’s meaning. When an array is really a set — a list of tags, permissions or IDs — enable Ignore array order: elements are then matched by their canonical JSON value, and only unmatched elements are reported.
A change of type is always reported, even when the values look alike. 1 and "1" are different, and so are null and a missing key. These subtle changes are a common cause of broken API clients, especially in strongly typed languages.
Tips
- Use Format to pretty-print minified JSON before reading it.
- Invalid JSON is flagged with the parser’s error message. Trailing commas, single quotes and comments are not valid JSON.
- To compare raw text or code instead, use the Code Diff Checker. To pretty-print or validate a single document, use the JSON Validator & Beautifier.
Frequently asked questions
Does key order matter?
{"a":1,"b":2} and {"b":2,"a":1} are reported as equal. Only real value changes are listed.How are arrays compared?
[1,2,3] equals [3,2,1].What do the paths mean?
$.user.roles[2], so you can find it in your code or in a test assertion.Is a number 1 equal to the string "1"?
1 → "1". That kind of drift is a common cause of broken API clients.Is my JSON sent to a server?
Last updated . Launched with path-level diff report and ignore-array-order option.
Building something that needs live data?
ProWebLook APIs validate phone numbers, check WhatsApp accounts, verify emails and geolocate IPs. Try every endpoint in the browser, then grab a free API key.