Client-side · Path-level Semantic Diff

Semantic JSON Diff for API Payloads

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

Semantic JSON Diff Workbench

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

Waiting for input

Test Cases

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.

01 / DIFF CASE

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.

02 / DIFF CASE

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.

03 / DIFF CASE

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.

04 / DIFF CASE

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.

Concept & Workflow

What Is a Semantic JSON Diff Tool?

Line-based text diffs flood your screen with false positives whenever JSON keys are reordered or whitespace changes. A semantic JSON diff compares parsed field paths (such as $.user.profile.role) to pinpoint additions, removals, value updates, and type changes.

  • Ignore object key order: focus on field semantics by default, or turn it off to inspect key ordering differences.
  • Ordered or unordered arrays: compare array elements by index or as sorted value sets while preserving duplicates.
  • Path filtering & Markdown export: isolate specific sub-trees via substring filters and download a clean .md diff report.

How to Compare Two JSON Payloads Semantically

  1. 1Paste both payloads: enter the baseline JSON and target JSON in the input panes, or click "Load Demo".
  2. 2Set comparison rules: toggle key-order handling, choose indexed or unordered array mode, and add optional path filters.
  3. 3Review breaking changes: inspect path-level diffs on the right—deletions and type shifts count toward breaking changes.
  4. 4Download Markdown report: export a structured .md summary for API reviews, changelogs, or regression notes.

Related examples and guides

Deep Dive

Documentation

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.
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.