ORIGINAL (LEFT)
MODIFIED (RIGHT)
DIFFERENCES+ added   - removed   ~ changed

  

What is a JSON diff?

A JSON diff compares two JSON documents and lists the differences between them. It is useful for checking what changed between two API responses, two versions of a config file, or a test result and its expected value.

How to use it

Paste the original JSON on the left and the changed JSON on the right, then press Compare. Each difference is shown with its path, for example $.user.age, so you can find it quickly.

How are arrays compared?

Arrays are compared position by position. If an item is inserted at the start of an array, the items after it will show as changed. Object keys are compared by name, so the order of keys does not matter.

Example

Original (left):

{"user":{"name":"Ali","age":24}}

Modified (right):

{"user":{"name":"Ali","age":25,"city":"Jhelum"}}

The comparison lists $.user.age as changed and $.user.city as added. The name is the same on both sides, so it is not reported as a difference.

Is my data safe?

Yes. The comparison happens in your browser with JavaScript. Nothing is sent to a server.

JSON comparator for objects and arrays

This JSON comparator checks two JSON documents and lists what was added, removed or changed, so you can compare JSON files, API responses or config versions without reading them line by line. If a document will not load, fix it with the JSON Repair tool or check it with the JSON Formatter first, and use Merge JSON to combine two versions afterwards.

Frequently asked questions

Does the order of keys matter?

No. Object keys are matched by name, so two objects with the same keys and values in a different order are treated as equal.

Do spaces and line breaks matter?

No. Both documents are parsed first, so indentation, spaces and line breaks do not count as differences. Only the data is compared.

Why does inserting one array item show many changes?

Arrays are compared position by position. When an item is added at the start, every item after it moves down one place, so each of those positions is reported as changed. To see a cleaner result, compare arrays whose items are in the same order.

What if one side is not valid JSON?

Both sides must be valid JSON. If one is not, check it first with the JSON Formatter, which helps you find the syntax error.

Related tools

Clean up messy input with the JSON Formatter before comparing. Combine two files with Merge JSON, or break a large file into parts with the JSON Splitter. Convert a result with JSON to CSV or JSON to YAML.