JSON Compare & Diff

Structural, key-order-insensitive diff of two JSON documents.

The JSON Diff tool compares two JSON documents and lists exactly what was added, removed or changed, with the path of each difference. It compares the data rather than the text, so reordered keys and different formatting do not count as changes. Use it to compare API responses, config versions or test fixtures.

What is a semantic JSON diff?

A text diff compares files line by line, so two JSON documents with the same data but different key order or indentation look very different. A semantic diff parses both documents first and compares the values. Objects are compared key by key, so the order of keys does not matter. Arrays are compared by position: the first element on the left is compared with the first on the right, and so on, so inserting an item at the start of an array makes every later position look changed. Each difference is reported with a JSONPath such as $.c.d and one of three kinds: added (only in the right document), removed (only in the left) or changed (present in both with different values, including a change of type, such as 1 and "1").

How to use JSON Compare & Diff

  1. Paste the original Put the original document in the Left (original) JSON box.
  2. Paste the modified version Put the new document in the Right (modified) JSON box.
  3. Read the differences The summary shows counts of added, removed and changed values, followed by a list with the kind, path and the old (-) and new (+) values.
  4. Copy the report Click Copy report to copy the list as text, one difference per line.

Frequently asked questions

Does key order matter?

No. Objects are compared by key, so the same data in a different key order is identical.

How are arrays compared?

By position. Element 0 is compared with element 0, element 1 with element 1, and so on. Extra elements on one side are reported as added or removed.

Why does inserting one array item show many changes?

Because items are matched by position, every later item is compared with a different item than before. Sort both arrays the same way first if the order is not meaningful.

What do the paths mean?

$ is the root, .key selects an object property and [n] selects an array element, for example $.users[0].name. Keys with unusual characters use bracket form with quotes.

Is my JSON sent to a server?

No. Both documents are compared in the page and nothing is sent anywhere.