JSON Diff Checker

Compare two JSON documents by key path, so reordering or re-indenting never shows as a false change.

How to use

  1. Paste the original JSON on the left and the changed JSON on the right.
  2. Every added, removed and changed key appears in the list below, by key path.
  3. Reordering keys or re-indenting either side never shows as a change.
  4. Narrow the list with the Added, Removed and Changed chips, switch to Side by side to see both documents formatted and aligned, or copy the change list.

Structural diff, not text diff

Two JSON documents can be byte-for-byte different and mean exactly the same thing: different key order, different indentation, a trailing newline. A text or line diff sees all of that as "changed." This tool parses both sides first and compares the resulting values by key path, so only an actual difference in meaning, a key added, removed or holding a different value, ever shows up.

Example

The shared sample pair reports exactly these changes:

$.tags[1]
$.address.postcode
$.address.country
$.verified
$.active

An object with reordered keys reports zero changes:

{"a":1,"b":2} vs {"b":2,"a":1}
-> 0 changes

Options explained

Edge cases and common errors

Do the same thing in code

// JavaScript: a quick structural diff for simple cases
function deepEqual(a, b) { return JSON.stringify(a) === JSON.stringify(b); }
// Note: this is order-sensitive for object keys unless you sort them first,
// and doesn't tell you *what* changed the way this tool's key-path list does.

Comparing plain text or source code instead of JSON? The Text Diff Checkerhandles line and word-level changes, with basic syntax highlighting for common languages.

JSON Diff Checker FAQ

Why does reordering keys not show as a change?

Because the comparison is by key path, not by text position: {"a":1,"b":2} and {"b":2,"a":1} have their keys in a different order but describe the exact same object, so this tool reports 0 changes between them. A plain text or line diff of the same two strings would show every line as different, purely from the reordering, which is the single most common complaint about feeding JSON into a generic diff tool instead of one built for it.

How are array changes handled? Does inserting one item shift everything after it?

No. Arrays are compared by matching elements, not by index position, so inserting one item in the middle of a list reports exactly that one addition. [1,2,3] changed to [1,99,2,3] reports only $.list[1] added (value 99), not three separate "index 1 changed, index 2 changed, index 3 added" entries the way a naive position-by-position comparison would.

What happens if a value changes type, like an object becoming an array?

It is reported as a single "changed" entry at that path with both the old and new value shown in full, rather than trying to diff an object against an array as though they were comparable structures.

What if one side is not valid JSON?

The error names which side is the problem and where: pasting {"a":} on the original side gives "Unexpected token '}'" labeled as the Original JSON, with the line and column when the parser can determine one. Leaving a side empty is refused too, with a message naming that specific side ("Paste the original JSON.") rather than a generic "invalid input."

Does anything get uploaded?

No. Both documents are parsed and compared entirely in your browser; this page is a static file with no server behind it.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta.