Home / JSON tools / JSON diff

JSON Diff

Paste two JSON documents and see exactly what was added, removed or changed, with the path to each difference.

Options

Result

What a JSON diff does

A JSON diff compares two JSON documents and lists the differences between them. It understands the structure of the data, so it tells you that the value at $.user.address.city changed from "Paris" to "Lyon", rather than just that some lines are different. Reformatting the JSON, or putting the keys in a different order, is not a difference.

Left:   {"name": "Ada", "langs": ["JS", "Python"], "active": true}
Right:  {"active": true, "name": "Ada", "langs": ["JS", "Go"], "age": 36}

changed  $.langs[1]   "Python" -> "Go"
added    $.age        36

How to use it

  1. Paste the original JSON in the left box and the changed JSON in the right box. An example is loaded so that you can see the result at once.
  2. The comparison runs as you type. Differences are listed in the Changes tab, with the path, the kind of change and the old and new values.
  3. Open the Side by side tab to see both documents with the changed lines highlighted.

Reading the results

  • Added: the key or array item exists only in the right document.
  • Removed: it exists only in the left document.
  • Changed: the same path holds a different value. If the type also changed, for example from a number to a string, the change is marked as a type change.

Paths use the dollar sign for the root, dots for keys and square brackets for array positions, as in $.items[2].price.

Errors in your JSON

If a side is not valid JSON, the tool tells you what is wrong and where, with the line and the column. Common causes are a trailing comma, single quotes and unquoted keys. Tick Allow comments and trailing commas to compare files in the JSONC style used by many config files.

More control

You can ignore the order of items in arrays, ignore keys such as updatedAt, ignore letter case, or match array items by an id. Those options are explained on the JSON compare page. To compare files from your computer, use compare two JSON files. For a full side by side view with line numbers, use the JSON diff viewer. The guide to JSON diff explains the ideas behind it.

Everything is done in your browser, and your JSON is never uploaded.

Frequently asked questions

How do I compare two JSON files?

Paste or open the two documents. The differences are listed at once, with the path of each added, removed or changed value.

Does key order matter?

No. JSON objects are unordered, so the same keys in a different order are not reported as a difference.

How are arrays compared?

By position, unless you tick Ignore array order or match the items by a key such as id.

Is my JSON sent to a server?

No. The comparison runs in your browser.