Skip to content
ToolMug

JSON Compare

See exactly what changed between two versions of a JSON config, API response or data file. Differences are listed by path, such as $.users[2].email, so reordered keys and reformatting do not show up as changes.

Runs in your browser — nothing you enter is uploaded

Paste JSON on both sides to compare them.

How to use

  1. Paste the original JSON on the left and the changed JSON on the right.
  2. Choose whether array order matters.
  3. Read the list of added (+), removed (−) and changed (~) values, or copy it as a report.

Options explained

Compare by position
Items in arrays are compared one by one. Inserting an item at the start therefore changes every following position.
Ignore order
Arrays are treated as unordered collections; only items that exist on one side and not the other are reported. Useful for lists of IDs, tags or records.
Paths
Paths use JSONPath notation: $ is the root, .key a property, [0] an array item and ["a b"] a key that is not a plain name.

Example

Take these two documents, where the keys are in a different order and some values differ:

{"name": "Ada", "age": 36, "tags": ["x", "y"], "address": {"city": "Rome"}, "first name": "A"}
{"age": 37, "name": "Ada", "tags": ["y", "x"], "address": {"city": "Rome", "zip": "00100"}, "first name": "B", "role": "admin"}

Compared by position, the result is:

Change Path Before After
~ $.age 36 37
~ $.tags[0] “x” “y”
~ $.tags[1] “y” “x”
+ $.address.zip “00100”
~ $["first name"] “A” “B”
+ $.role “admin”

With Ignore order switched on, the two tags changes disappear, because both arrays hold the same two values. The key order has no effect in either mode. A value that changes type, such as a number that becomes a string or an object that becomes an array, is reported as one change at its own path.

Frequently asked questions

How is this different from a text diff?

A text diff compares lines, so formatting and key order show up as changes. JSON Compare parses both sides and compares the data itself.

Are 1 and "1" treated as equal?

No. A number and a string are different JSON values, so the change is reported with both values.

Is my data uploaded?

No. Both documents are compared in your browser.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools