Back to tools

JSON Diff

Compare JSON documents the way developers think: by meaning, not by text

Two JSON documents can describe the identical object while looking completely different on screen — one is pretty-printed, the other minified; one lists object keys in a different order; one adds a harmless whitespace. A line-by-line text diff screams about all of it, burying the one real change you care about. This diff tool compares JSON structurally instead: it parses both documents and reports only actual differences in values, additions, and removals, ignoring formatting and key order within objects.

Use it when you are debugging a failing API contract, reviewing a config change, or checking whether a refactor altered a response shape. It tells you what changed, not just that something changed.

Find the Difference in Five Steps

  1. Paste the original JSON into the left panel and the modified JSON into the right panel.
  2. Click Compare; both documents are parsed before any comparison begins.
  3. Read the result: changed values, added keys, and removed keys are listed with their paths, such as settings.timeout.
  4. Spot-check the flagged paths in your source files to confirm each change is intentional.
  5. Repeat after each fix until the diff reports no differences.

Real Example: A Config Change Buried in Formatting

A service config went from one line to fifty during a refactor, and the pull request shows a giant text diff. Structurally, only one value changed. The tool ignores reordering and whitespace and reports a single difference: retries changed from 3 to 5.

Left DocumentRight DocumentReported Diff
{"retries":3,"host":"db"}{"host":"db","retries":5}retries: 3 -> 5

Diffing Without the Noise

When Structural Diffing Pays Off

Frequently Asked Questions

Why does the diff ignore the order of object keys?

JSON objects are unordered collections of key-value pairs, so two documents with the same pairs are equal regardless of key order. Arrays are ordered, so their element order still matters.

Does whitespace or indentation count as a difference?

No. Both documents are parsed into their internal structure before comparison, so pretty-printed versus minified input produces no differences unless values actually changed.

What does a diff path like settings.timeout mean?

It is the location of the change inside the document: navigate to the settings object, then read the timeout key there. Array elements use numeric indexes in the path.

How are arrays compared?

Element by element at the same index. Because order is significant in arrays, inserting an item at the front shifts every subsequent index and can produce a long diff.

What happens if one document is invalid JSON?

Comparison stops and the tool reports the parse error from the invalid side. Fix the document with the JSON validator, then compare again.

Does the tool handle deeply nested structures?

Yes. Differences at any depth are reported with their full path, so a change five levels down is just as visible as one at the root.

Is null different from a missing key?

Yes. null is an explicit value, while a missing key is the absence of that key. The diff reports them as distinct changes: a removal versus a value set to null.

Can this diff catch type changes?

Yes. A value changing from "3" to 3 is a real difference — string versus number — and is reported even though the text looks similar.