Skip to content
Menu
Theme

JSON Compare

Compare two JSON documents and see every added, removed and changed value with its exact path. Free, and it runs entirely in your browser.

DeveloperRuns in your browser
Differences
5
$.age
Changed: was 30, now 31
$.city
Removed: "Hà Nội"
$.tags[0]
Changed: was "a", now "b"
$.tags[1]
Changed: was "b", now "a"
$.email
Added: "an@example.com"

What is a JSON compare tool?

A JSON compare tool puts two pieces of JSON side by side and tells you how they differ. Instead of a line-by-line text diff, it looks at the data itself. It walks through both documents and lists each value that was added, removed or changed, together with the path to it, such as $.users[2].name.

This helps whenever you have two versions of the same data. You might compare an API response before and after a release, two config files from different servers, a saved test fixture against today’s output, or the settings a customer sent you against your defaults. With a plain text diff, a change in spacing or key order makes every line look different. Here those do not count.

The comparison ignores whitespace and the order of keys inside objects, because neither changes what the JSON means. Two objects with the same keys and values are equal, however they are laid out. Array order is different. In most data, the first item of a list means something, so by default the tool compares arrays position by position. If your arrays are really sets, such as a list of tags or permissions, tick the option to ignore array order and the tool will only check that both sides hold the same items.

Each change shows the path, the kind of change and the values. A value that changed type, for example from the number 5 to the text “5”, is reported as a type change, so it stands out from an ordinary edit. Numbers are compared by their exact value, so 1.0 and 1 count as equal, and very long numbers are compared digit by digit without rounding.

Everything runs in your browser. Neither document is sent anywhere, which matters when your JSON holds tokens, customer data or other private details.

How to use the JSON compare tool

  1. Paste the first version into the Original box. Both boxes start with a small sample.
  2. Paste the second version into the Changed box.
  3. Tick the option to ignore array order if the order of items in your lists does not matter.
  4. Read the number of differences, then go through the list of changes. Each row shows the path, the kind of change, and the value before and after.
  5. If either side is not valid JSON, a message under that box shows the line and column of the problem.

FAQ

Why does the tool say my files are the same when a text diff shows changes?

The tool compares data, not text. Extra spaces, different line breaks and keys written in a different order do not change the data, so they are not counted. A text diff counts all of those.

What does ignoring array order do?

With the option off, the first item is compared with the first item, the second with the second, and so on. With it on, the tool checks whether both arrays hold the same items, in any order. Use it for lists where position has no meaning.

How do I read a path like $.users[2].name?

The dollar sign stands for the whole document. A dot followed by a name steps into that key, and a number in square brackets picks an array item, counting from zero. So that path means the name of the third user.

What is a type change?

It is a change where the kind of value is different on each side, such as a number becoming a string, or an object becoming an array. These often point to a bug in the code that produced the JSON, so the tool marks them on their own.

Is there a limit on the number of differences?

The tool counts every difference but lists at most a few hundred rows on screen, with a note telling you how many more there are. If you see that many, the two documents probably have a different shape at a higher level.

Is my JSON uploaded anywhere?

No. The comparison runs inside the page on your own device. Nothing is sent to a server, and nothing is kept after you close the tab.

Related tools