Javascript is required

Semantic JSON Diff for API Payloads

Semantic JSON Diff Workbench

Compare field paths, choose array order rules, and filter visible changes. Breaking flags require contract review.

Arrays:
Path Filter:
Base JSON (Original)
Target JSON (New Version)
Diff Result

Waiting for input

Four reproducible API comparison cases

Load a case to replace both inputs and reset all comparison options. Change one option to observe the alternative result.

Object keys reordered

Baseline input

{
  "id": 101,
  "status": "active"
}

Changed input

{
  "status": "active",
  "id": 101
}

Initial options: Ignore key order on; ordered arrays; no filters.

Expected result: No differences. Disable Ignore Object Key Order to show one key-order row at $.

Key order is an optional comparison signal, not a business compatibility test.

Array values reordered with a duplicate

Baseline input

{
  "tags": ["reader", "admin", "reader"]
}

Changed input

{
  "tags": ["reader", "reader", "admin"]
}

Initial options: Ignore key order on; ordered arrays; no filters.

Expected result: Two changed rows at $.tags[1] and $.tags[2], with zero breaking flags. Switch Arrays to Unordered Set to see no differences.

Unordered comparison retains duplicates and does not match items by ID.

A path substring matches two fields

Baseline input

{
  "user": {"name": "Ada"},
  "username": "ada",
  "version": 1
}

Changed input

{
  "user": {"name": "Grace"},
  "username": "grace",
  "version": 2
}

Initial options: Ignore key order on; ordered arrays; path filter user.

Expected result: Shows $.user.name and $.username, while hiding $.version. Set the filter to missing to hide all rows; the overall payloads still differ.

Filters hide report rows. They are case-insensitive substrings, not JSONPath queries.

Deletion and a changed value type

Baseline input

{
  "id": 101,
  "displayName": "Ada",
  "active": true
}

Changed input

{
  "id": "101",
  "active": false,
  "role": "reader"
}

Initial options: Ignore key order on; ordered arrays; Breaking Changes Only on.

Expected result: Two breaking rows: $.id is type-changed, and $.displayName is removed. Disable Breaking Changes Only to also see $.active changed and $.role added.

A value change is not flagged as breaking even when application behavior depends on it.

How this JSON comparison works

Paste the baseline and changed payloads, then inspect additions, removals, value changes and type changes by field path. Object key order is ignored by default; turning that option off also reports key-order differences.

Choose indexed or unordered array comparison before reviewing a report. Path and breaking-only filters hide rows; the overall change status and breaking count still describe the complete comparison. Downloaded Markdown includes the visible rows and overall count.

Usage Boundaries & Limitations

  • Unordered mode sorts serialized values before comparison and retains duplicate items. It does not match records by an ID field; reported array indexes refer to the sorted arrays.
  • Path filters are case-insensitive substrings, separated by commas. They are not JSONPath expressions: user matches both $.user.name and $.username.
  • The breaking flag marks removals and type changes only. A changed enum, unit, meaning or newly added field can still break a consumer without receiving this flag.
  • Invalid JSON falls back to text comparison, without a semantic report. Valid input uses JSON.parse, so large numbers can lose precision. Comparison runs on the main thread; memory and rendering costs depend on the input, with no fixed file-size guarantee.

Frequently Asked Questions (FAQ)

Will changing only object key order produce a diff?▼

With Ignore Object Key Order enabled, the key-order example has no differences. Disable it to report a key-order row at $. Added or removed keys can also change the recorded key sequence.

Does unordered array comparison remove duplicates or match IDs?▼

No. It sorts serialized values, keeps duplicates, and compares the sorted items by index. Reordering the same values is ignored, but deleting a duplicate is still a removal. Records are not matched by an ID field.

Why does user also match username in a path filter?▼

The filter searches for a substring anywhere in the reported path, ignoring case. Commas separate alternatives. If no rows match, the overall difference status remains true when the complete payloads differ.

Does zero breaking changes prove an API update is compatible?▼

No. Only removals and type changes are flagged. Value changes can alter application behavior, and filters do not reduce the overall breaking count. Review the report with the API contract and consumer tests.