Compare two JSON files

Paste two JSON documents, or open two files, and get every added, removed and changed value with its exact path. Key order and formatting are ignored, numbers are compared by value, and the comparison runs in your browser.

diff original.json changed.json

  • key order and whitespace ignored
  • numbers compared by exact value
  • null and a missing key kept apart
  • duplicate keys and big integers flagged
  • runs in your browser, nothing uploaded
arrays

Order matters, but an inserted or deleted item is shown as one change, not as every item after it.

Valid JSON.

Valid JSON.

diff

7 differences: 3 changed, 3 added, 1 removed.

~3 +3 −1
  • 32line 3 in the original, line 2 in the changed document:
    "pending"→"shipped"
  • 6–line 6 in the original:
    "ada@example.com"
  • 77line 7 in the original, line 7 in the changed document:
    null→"+44 20 7946 0000"null → string
  • –10line 10 in the changed document:
    {"sku": "CB-03", "qty": 1, "price": 17.50}
  • 213line 21 in the original, line 3 in the changed document:
    138.90→156.4
  • –28line 28 in the changed document:
    "priority"
  • –30line 30 in the changed document:
    "2026-11-18T09:30:00Z"

original · formatted

{
"id": 48213,
Changed: "status": "pending",
"customer": {
"name": "Ada Byron",
Removed: "email": "ada@example.com",
Changed: "phone": null
},
"items": [
{
"sku": "KB-01",
"qty": 1,
"price": 89.90
},
{
"sku": "MS-07",
"qty": 2,
"price": 24.50
}
],
Changed: "total": 138.90,
"tags": [
"gift"
]
}

changed · formatted

{
Changed: "status": "shipped",
Changed: "total": 156.4,
"id": 48213,
"customer": {
"name": "Ada Byron",
Changed: "phone": "+44 20 7946 0000"
},
"items": [
Added: {
"sku": "CB-03",
"qty": 1,
"price": 17.50
},
{
"sku": "KB-01",
"qty": 1,
"price": 89.9
},
{
"sku": "MS-07",
"qty": 2,
"price": 24.5
}
],
"tags": [
"gift",
Added: "priority"
],
Added: "shippedAt": "2026-11-18T09:30:00Z"
}

How to compare two JSON files

  1. Paste the original JSON on the left and the changed JSON on the right. You can also drop a .json file onto either box or use Open file.
  2. The comparison updates as you type. If a side is not valid JSON, the box shows the line and column of the problem and what is wrong.
  3. Read the list of differences. Click a path to jump to that value in the formatted views below it.

Ctrl+Enter (⌘+Enter on a Mac) compares straight away. Swap sides flips which document counts as the original, so additions become removals.

What the tool treats as equal

A text diff compares characters. This tool compares the data, so changes that do not change the data are not reported. On the example above, a line-by-line text diff flags 7 of the original's lines; the tool reports 7 real differences.

  • Key order and whitespace. {"a":1,"b":2} and {"b":2, "a":1} are the same object. JSON objects are unordered by definition.
  • How a number is written. 89.90, 89.9 and 8.99e1 are the same number. Comparison is on the exact decimal value, so large IDs such as 9007199254740993 are not rounded the way JSON.parse rounds them.

These are reported, because they change the data:

  • A string versus a number ("1" vs 1), shown with the type change.
  • null versus a missing key. A key set to null exists; a missing key does not.
  • Letter case and spaces inside strings.

The tool also warns you about two things that make JSON behave differently in different programs: a key that appears twice in the same object, and numbers too large for JavaScript to hold exactly. What counts as a JSON difference explains each rule with examples.

How arrays are compared

Arrays are where JSON comparison tools disagree most, so you choose:

  • Detect moves (the default). Order matters, but the tool looks for the longest run of items the two arrays share, so inserting one item at the start is one change. In the example, a new first item in items is reported once. Compared by position, the same pair of documents shows 12 differences instead of 7, because every item after the insert looks edited.
  • By position. Item 0 against item 0, item 1 against item 1. Use it when position carries meaning, such as coordinates or table rows.
  • Ignore order. The arrays count as equal when they hold the same items in any order, like a set, except that duplicates still count. Use it for tags, permissions and other lists where order is incidental.

Reading the result

Each difference shows a path written the way you would in JavaScript, such as customer.email or items[0].sku. Hover over it for the same location as a JSON Pointer (/customer/email), the format JSON Patch and many APIs use. Changed values show old → new. In the formatted views, changed lines are amber, added lines green and removed lines red, and each line also carries a text label for screen readers.

When a whole object or array is added or removed, it is reported once at its own path, not once for every value inside it.

Is it safe to paste private JSON?

The comparison runs in JavaScript inside your browser tab. The JSON you paste or open is not uploaded, logged or stored, and the page works offline once loaded. You can check this in your browser's developer tools: comparing sends no network requests. That said, treat secrets such as API keys and access tokens with care on any website.

Common questions

Can it compare large JSON files?

Yes, up to 20 MB per file. Files of a few megabytes compare in well under a second on a laptop. For very long arrays that differ a lot, the move detection switches to position-by-position so the page stays responsive.

Does it accept JSON with comments or trailing commas?

No. The tool reads strict JSON, the same as JSON.parse and most APIs, and tells you the exact line of the comment or trailing comma so you can fix it. JSON5 and JSONC files need those removed first.

Can I get the differences as a JSON Patch?

Not yet. The list shows each change and its JSON Pointer, which is the path a patch uses. To write the patch yourself, see JSON Patch explained and JSON Patch vs JSON Merge Patch.

How is this different from a text diff?

A text diff tells you which lines differ. This tells you which values differ and where they sit in the structure. Reformatting a file or reordering its keys produces a large text diff and zero differences here.

Last updated November 18, 2026. The rules the tool follows are explained in what counts as a JSON difference.