Compare

JSON Diff: Compare Two JSON Documents

Paste two versions of a JSON document to see exactly which values were added, removed or changed, and where.

How to compare JSON

  1. Paste the original JSON on the left and the changed version on the right, or open two files.
  2. The differences appear below as you type, with a count of additions, removals and changes.
  3. Each row shows the path to the value, such as $.dependencies.react or $.items[2].price, plus the before and after values.
  4. Copy or download the result as a plain-text report.

A structural diff, not a text diff

A normal text diff reports changes when keys are reordered or indentation changes. JSON Diff parses both documents first and compares the data, so:

  • Key order doesn't matter. {"a":1,"b":2} and {"b":2,"a":1} are equal.
  • Whitespace and formatting don't matter. Minified and pretty-printed JSON compare as equal.
  • Numbers are compared by value. 1.0 and 1 are equal, and very large integers are compared exactly.

Comparing arrays

By default arrays are compared position by position, which suits ordered data like a list of steps. Turn on Ignore array order when the order is meaningless, for example a list of tags or permissions. Then only items that appear on one side but not the other are reported.

Frequently asked questions

Does key order affect the result?

No. Objects are compared by their keys and values, so reordering keys is not reported as a change.

What does the $ in a path mean?

It stands for the root of the document. $.user.name means the name key inside the user object, and $.items[0] is the first item of the items array.

How are arrays compared?

Item by item by position. Turn on Ignore array order to treat arrays as unordered collections.

Can I compare invalid JSON?

Small issues such as trailing commas or single quotes are tolerated. If a side cannot be parsed, the error message shows which side and where.

Is my data uploaded?

No. The conversion runs with JavaScript inside your browser tab. Nothing you paste or open is sent to a server or stored.