Skip to content
Easy Diff Checker
In this guide

JSON

How to compare two JSON files without drowning in noise

A normal text diff of JSON is hard to read. Learn how to compare two JSON files by meaning, handle key order and arrays, and find the one value that changed.

November 24, 2026 · 3 min read

You have two API responses from the same endpoint. One works and one doesn’t. Each has about 600 lines of JSON, and somewhere inside is the value that is wrong.

You can paste both into a normal text diff checker, but the result is often a mess of red and green. One file may have its keys in a different order, or different spacing. None of that is a real difference. It only hides the one change you are looking for.

Why a text diff is hard to use for JSON

JSON is data, not plain text. Two files can mean exactly the same thing and still look very different. For example:

{ "name": "Ada", "role": "admin" }
{
  "role": "admin",
  "name": "Ada"
}

Both are the same object. A line-by-line diff will say every line changed. A JSON-aware comparison will say nothing changed, which is the correct answer.

What a good JSON comparison does

  • It ignores formatting. Spaces, indentation and line breaks do not matter.
  • It ignores key order. An object has no order, so the comparison should not care about it either.
  • It shows where the change is. Instead of “line 212 is different,” you see a path like user.address.postcode, so you know which field changed.
  • It shows the type of change. A value can be added, removed or changed. A number that became a string is a different problem from a missing field, and you should be able to tell them apart.

How to compare two JSON files

Here are the steps with our JSON compare tool:

  1. Paste or drop the first JSON on the left and the second one on the right.
  2. Run the comparison.
  3. Read the changes by path. Each one shows the old value and the new value.
  4. If you need to apply the changes somewhere else, export the result as a JSON Patch.

The tool runs in your browser, so you can paste real responses without worry. This matters because API responses often contain tokens, emails and customer data.

The array problem

Arrays are the trickiest part of comparing JSON. Here is a list of users:

[{ "id": 1, "name": "Ada" }, { "id": 2, "name": "Linus" }]

Suppose the second file has the same two users in the opposite order. Is that a change? Technically, yes, because arrays have an order. In practice, usually no. You want the two items matched by their id, so the result says “nothing changed” or “Linus’s name changed,” instead of “both items were replaced.”

That is why it helps to use a tool that can match array items by a key such as id. If your array order really matters, for example a list of steps, keep the default and let the order count. For a plain list of values, such as names or IDs, the list diff checker is a simpler fit. If your data lives in a spreadsheet, try the Excel and CSV diff checker.

Common reasons two JSON files are different

  • A field is missing in one environment because of a setting or a feature flag.
  • A number is a string in one response ("42" instead of 42). It looks the same on screen but behaves differently in code.
  • null in one file and a missing key in the other. Many systems treat these differently.
  • Timestamps or generated IDs that change on every request. These always show up as differences, so you can look past them.
  • Small rounding differences in decimal numbers, such as 0.1 and 0.10000000000000001.

A simple routine for debugging

When something works in one environment and fails in another, try this:

  1. Get the response from both, using the same input.
  2. Compare them by meaning, not as plain text.
  3. Set aside the fields you expect to be different, such as timestamps and IDs.
  4. What remains is your list of suspects. It is usually short.

Summary

A JSON diff is only useful if it ignores the things that don’t matter. Compare by meaning, match array items by id when it makes sense, and keep your data on your own device. Then the one wrong value is much easier to find.

See it in action

Original

{
"id": 1,
"name": "Ada",
"role": "admin",
"age": "42"
}

Changed

{
"id": 1,
"name": "Ada",
"role": "editor",
"age": 42,
"email": "[email protected]"
}

Three real differences here: the role changed, the age went from a string to a number, and the email field is new. The tool lists each one by its path.

Open this example in the JSON compare tool

Quick answers

Does key order matter when comparing JSON?

Not for the data. {"a":1,"b":2} and {"b":2,"a":1} mean the same thing, so a good JSON comparison ignores key order. A plain text diff does not.

How do I compare JSON arrays?

Arrays are ordered, so a new order counts as a change by default. If the items have an id, match them by that id. Then a reordered list is not shown as many changes.

Is it safe to paste API responses into an online JSON diff tool?

Only if the tool runs in your browser and does not upload anything. Easy Diff Checker compares JSON on your device, so tokens and personal data stay with you.

Share this guide

More guides

In this guide

History

Stored only in this browser. Up to 50 checks.

Keyboard shortcuts

Compare
⌘↵
Next change
]j
Previous change
[k
Show this list
?
Close dialogs and menus
Esc

Letter shortcuts are ignored while you type in a text box.