Skip to content

JSON Diff - Compare JSON Documents Online

JSON A (Original)
JSON B (Modified)

About JSON Diff

Tracking down what changed between two JSON documents is a common chore. Maybe you are comparing a staging API response against production, reviewing a config file before and after a deploy, or checking that a migration script transformed data correctly. Plain text diffs are noisy because whitespace and key order create false positives. This tool parses both documents and compares them structurally, so only real data differences show up.

Every difference is reported with its path, such as $.user.email or $.items[2].price, plus the old and new values.

How to Use It

Paste the original JSON into the left editor and the modified JSON into the right editor. The diff results panel below updates automatically. Each row shows a coloured status badge (green for additions, red for removals, yellow for changes), the affected path, and the old and new values. If both documents are structurally identical, you will see a confirmation message instead.

What Counts as a Difference

  • Key order and formatting are ignored. {"a":1,"b":2} and a pretty-printed {"b":2,"a":1} are equal. So are 1 and 1.0, which are the same JSON number.
  • Types matter. 1 and "1", or null and a missing key, are reported as different.
  • Arrays are compared by position. Index 0 is compared with index 0, and so on. If an item is inserted at the start of a list, every later item shows as changed and the last one as added. Sort both arrays the same way first if order does not matter to you.
  • Large integers are exact. 64-bit IDs such as 12345678901234567890 are compared digit for digit instead of being rounded to the same JavaScript number.

To compare JSON as text instead, including formatting and key order, use the text diff. To tidy both inputs before reading them, run them through the JSON formatter.

Related Tools

Frequently Asked Questions

What kind of differences does this tool detect?
It detects three types of differences: additions (keys present in the second JSON but not the first), removals (keys present in the first JSON but not the second), and changes (same key exists in both but the value is different). Each difference includes the full path to the affected field.
Does it handle nested objects and arrays?
Yes. The comparison walks both documents recursively. Nested objects are compared key-by-key and arrays are compared element-by-element, so differences at any depth are reported.
What path format is used in the results?
Paths use JSONPath dot notation starting from `$`. Object keys appear after a dot (e.g. `$.user.name`) and array elements use bracket notation (e.g. `$.items[0]`).
What happens if one of my inputs is not valid JSON?
The tool shows a clear error message indicating which side has the syntax problem. Fix the issue and the diff will re-run automatically.
Is my data sent to a server?
No. Both documents are parsed and compared entirely in your browser. Nothing is transmitted over the network.