JSON Diff · Tutorial

How to compare two API responses to find a breaking change

7 min readintermediateUpdated

Your app works against one environment but breaks against another, or it broke after a backend release. Often the cause is a small change in the API response, like a field that disappeared or a number that became a string, hidden among values that are supposed to differ. This tutorial shows how to compare two responses with the JSON Diff tool, separate expected differences from breaking ones, and report what you found.

What you need

  • The JSON Diff tool
  • Two JSON responses for the same request, for example from staging and production (the Try it button loads a user profile from two environments)

Steps

  1. Capture both responses

    Make the same request against both environments and copy each response body, for example from the Network tab of your browser's developer tools, or with curl. Paste the working one on the left as Original and the failing one on the right as Changed.

  2. Read the summary

    The summary shows 4 differences for the sample, with 2 removed and 2 changed. That's a short list to review, much easier than reading two full responses side by side.

  3. Ignore the expected differences

    Open the Changes tab. Some differences are normal between environments or over time, like $.lastLogin, which is just a timestamp. Skip these and focus on the rest.

  4. Find the breaking changes

    Three changes in the sample can break a client. $.plan.seats changed type, from the number 5 to the string "5", so code doing seats + 1 now produces "51". $.features[2] ("sso") was removed, so a check for SSO now fails. And $.limits.storageGb is missing entirely, so code reading it gets undefined.

    ~ $.plan.seats: 5 → "5"
    - >-
      $.features[2]: "sso"
    ~ $.lastLogin: "2026-10-28T09:12:44Z" → "2026-10-30T07:58:02Z"
    - >-
      $.limits.storageGb: 100
  5. Check the context

    Switch to the Line diff tab to see each change within the full, formatted document. This helps when the same field name appears in several places.

  6. Share a precise report

    Press Copy change list and paste it into the bug report or chat. The JSONPaths make it unambiguous which fields changed, so the backend team can find the cause quickly.

Try it yourself

Opens the JSON Diff with this tutorial's sample loaded.

Try it now

Common mistakes

Comparing different requests
Make sure both responses come from the same endpoint with the same parameters and user. Otherwise every field may differ for legitimate reasons.
Treating list order changes as bugs
If an array is reported as changed only because items moved, tick Ignore order of array items, unless your app depends on the order.
Missing type changes
A value that looks the same, like 5 and "5", is a real difference in JSON. These are easy to overlook in a text diff but are listed clearly here.

Next steps

Go back to the JSON Diff, or keep going with one of these:

FAQ

Can I compare very large responses?

Yes. Large documents are handled efficiently, and the change list shows the first 1,000 changes. Copy the change list to get all of them.