Skip to content
CleanGlyph home

JSON Diff & Compare Tool

Find added, removed, and changed values by JSON Pointer. Object key order is ignored; arrays are compared by position. Everything runs in your browser.

Your text never leaves your browser.

0 code points · 0 linesNot compared yet

0 code points · 0 linesNot compared yet

Differences

Enter JSON in both editors, or load the example.

Objects are matched by key in any order; arrays are matched by position.

How this JSON compare works

Paste into Original JSON and Modified JSON, then select Compare JSON. Both sides are parsed strictly. The tool counts all differences and includes up to 1,000 rows in the results and copied report. Large values or paths can reduce that number. Each row has a type and a JSON Pointer (RFC 6901) such as /roles/0. Objects are matched by key, so key order never matters. Arrays are matched by position. Numbers are compared by exact value, so 1 and 1.0 are equal.

Before and after example

This is the built-in example. Key order differs between the two documents, yet only real changes are reported. A removed or added member keeps its whole value in a single row.

Original JSON
{
  "name": "Ada",
  "active": true,
  "roles": [
    "reader"
  ],
  "legacy": null
}
Modified JSON
{
  "roles": [
    "writer",
    "admin"
  ],
  "name": "Ada",
  "active": false,
  "team": "ops"
}
ChangeJSON PointerOriginalModified
Changed/activetruefalse
Removed/legacynull—
Changed/roles/0"reader""writer"
Added/roles/1—"admin"
Added/team—"ops"

Copying the difference report

Copy report produces JSON with totals, a truncated flag and a changes list. Each change has a type, a path (the root is ""), and beforeJson or afterJson holding the original source text of each value. Inputs are limited to 512 KiB each and 128 levels of nesting. The tool counts all differences and includes up to 1,000 rows in the results and copied report. Large values or paths can reduce that number. Totals cover the full comparison; filters apply to retained rows. Copy report includes all retained rows, regardless of the selected filter, even when zero rows fit.

Related tools: validate or pretty-print first with the JSON Formatter & Validator, query values with the JSONPath Tester, or compare plain text line by line with the Text Difference Checker.

Frequently asked questions

Does object key order matter when I compare JSON objects?

No. Objects are compared by their keys, so {"a":1,"b":2} and {"b":2,"a":1} are equal at every level. Results are listed in a stable key order, sorted by UTF-16 code units, not in the order the keys were written.

How are arrays compared?

Arrays are compared position by position, and order matters. Inserting an item at the front shifts every later item, so [1,2] vs [0,1,2] reports changes at /0 and /1 and an addition at /2. Unordered or keyed array matching is not part of this tool.

Is a missing key the same as null?

No. A key whose value is null is present; a key that does not exist is absent. {"x":null} vs {} reports /x as Removed with the original value null. Types are also kept apart, so 1 and "1" are different.

What happens with duplicate keys?

A document with the same key twice in one object is rejected, because parsers disagree on which value wins. Keys are checked after decoding escapes, so "a" and "\u0061" count as duplicates. The same key in different objects is fine.

Are numbers like 1 and 1.0 treated as equal?

Yes. Numbers are compared by their exact decimal value without floating-point conversion, so 1, 1.0 and 1e0 are equal, -0 equals 0, and 9007199254740992 is still different from 9007199254740993. The report keeps each number exactly as you wrote it.

Is my JSON uploaded anywhere?

No. Parsing and comparison run entirely in your browser, in a background worker when available. Your JSON, the results and anything you copy are never sent to a server, stored or added to the URL.