JSON Compare — Structural JSON Diff

A text diff of two JSON files flags every reordered key and re-indented line. This tool understands JSON — it compares objects by key and arrays by position, so you only see real differences.

Structural vs. textual comparison

Two JSON documents can be textually different yet semantically identical: keys in a different order, different indentation, 1.0 vs 1, or trailing newlines. A structural compare parses both documents into trees and walks them together, reporting a difference only where a key is missing on one side, a value differs, or an array has different elements. The result is a precise list of paths such as spec.replicas or items[2].price rather than a wall of red and green lines.

Comparison options

Ignore key order (on by default) treats {"a":1,"b":2} and {"b":2,"a":1} as equal. Keys & types only compares the shape of the documents — useful for checking that a staging response has the same schema as production even when the data differs. Show only differences hides unchanged branches so large documents stay readable. Switch between a line-by-line view with inline highlights and a summary view listing each changed path.

Preparing documents for comparison

Both inputs must be valid JSON; parse errors are shown with their position. If you are comparing API responses, strip volatile fields such as timestamps, request ids and ETags first, or use the keys-and-types mode. For YAML sources (Kubernetes manifests, CI config), convert them with the JSON ↔ YAML Converter and then compare.

How to use it

  1. Paste the original JSON into panel A and the new version into panel B; the comparison runs automatically as you type. Use Format on either box to tidy it, or Load sample to see how the output looks.
  2. Choose options: ignore key order, keys & types only, show only differences. Swap exchanges A and B if you pasted them the wrong way round.
  3. Read the line-by-line view or the Summary tab, step through changes with the Prev and Next buttons, and use Copy report to paste a text report into a ticket or PR comment.

Example

A vs. B:

A: {"name":"web","replicas":2,"image":"web:1.4.0","env":{"LOG":"info"}}
B: {"image":"web:1.5.0","name":"web","replicas":3,"env":{"LOG":"info","TRACE":"on"}}

With key order ignored, the result is exactly three differences: replicas changed 2 → 3, image changed web:1.4.0 → web:1.5.0, and env.TRACE was added. The reordering of name and image is correctly ignored.

Common use cases

Frequently asked questions

How are arrays compared?

By position: element 0 with element 0, and so on. An inserted element therefore shifts later elements and shows as several changes. Sorting arrays on both sides first gives cleaner results when order is not significant.

Can it compare very large JSON files?

It runs in your browser, so the practical limit is your device's memory and speed; very large documents may feel slow. Use "show only differences" to keep the output manageable, and a command-line tool for huge files.

Does it treat 1 and 1.0 as equal?

Yes. Both parse to the same JSON number. Strings and numbers are not equal to each other, so "1" and 1 are reported as a type change.

Is my JSON uploaded?

No. Both documents are parsed and compared in your browser.

Related tools

Explore all developer tools →