b2KIT

API Response Diff Tool

Compare two API responses side by side with structural diff, value changes, and schema drift detection.

Tested tool guide Tested browser tools Checked August 16, 2026

What API Response Diff Tool does, with a checked example

This tool takes two JSON API responses, one as the baseline and one as the comparison, and walks both trees key by key to report what changed. It separates structural drift (fields added, removed, or changed type) from ordinary value changes, so a renamed or missing field reads differently from a value that simply got updated. The part people miss most: object key order never counts as a difference, but array element order does, so two arrays holding the same items in a different sequence often show up as changed even though nothing meaningful moved.

Worked example

A concrete input and expected output from the current implementation.

Input

A: {"id": 1, "name": "Alice", "role": "admin"}
B: {"id": 1, "name": "Alice", "role": "editor", "active": true}

Expected output

id: unchanged (1)
name: unchanged ("Alice")
role: changed, "admin" -> "editor"
active: added in B, value true (boolean), absent from A

id and name match exactly in both payloads, role has the same key in both but a different value, and active exists only in B, so it is reported as an added field rather than a value change.

How the result is produced

1

Tree-walk value diff

The tool parses both pasted responses as JSON, then recursively walks the two trees together, matching nodes by key path. At each path it classifies the result as unchanged, added, removed, or changed, and reports scalar value changes, such as a string or number that differs, separately from structural changes like a field disappearing entirely.

2

Schema drift flagging

Independent of whether values match, the tool compares the key set and JSON type (string, number, boolean, object, array, null) of each field across both payloads. A field present in only one response, or one whose type changed between responses, such as an id switching from number to string, is flagged as drift even when a human might read the values as equivalent.

Good uses

  • Comparing a staging and production response for the same endpoint to catch a field that changed unintentionally before a release
  • Checking that a new API version still matches the old response shape for existing consumers before rolling it out
  • Debugging a client failure after a backend deploy by pasting the last-known-good and current response bodies to see exactly which field moved

Limits and checks

  • Arrays are compared by position, not by matching content, so reordering array elements without changing any values can show up as several changed entries instead of a no-op
  • A value that changes both type and content in the same edit, such as "42" becoming true, is reported as one type-changed node, so read the type and value parts of that entry together rather than assuming only the value moved
  • The diff only reflects the two payloads you paste in that moment; it has no memory of prior comparisons or a live schema, so it cannot tell you whether a difference is new or has existed across many past responses

Common questions

Does key order in the JSON matter?

No. Both responses are parsed as JSON objects before comparison, and JSON itself defines objects as unordered key-value sets, so two objects with identical keys and values in a different order are treated as equal with no diff reported for the reordering.

Will it work on XML or plain-text API responses?

No, it expects valid JSON on both sides. Pasting XML, HTML, or plain text will either fail to parse or get treated as one unparsed value rather than being broken into comparable fields. For XML responses, use a dedicated XML comparison tool instead.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools