About this JSON compare tool
Paste JSON on the left and right, then click Compare. Differences are highlighted inside the two boxes—there is no separate result pane. Ignore array order is a checkbox in the right column header.
Object key order is not treated as a difference. Arrays match by index unless you turn on Ignore array order. Invalid JSON shows which side failed, often with line and column. For trailing commas or comments, fix on JSON repair & validate first.
JSON comparison — background
Structural equality vs text diff
JSON comparison here walks parsed values: objects, arrays, strings, numbers, booleans, and null. A plain text diff would flag reordered keys or whitespace; this tool ignores object key order so {"b":1,"a":2} equals {"a":2,"b":1}. What you see is semantic structure, not byte-for-byte text.
Arrays: order-sensitive by default
In JSON, array order matters: [1,2] and [2,1] are different values. Many API tests compare arrays by position. When you only care about multiset equality (same elements, any order), enable Ignore array order—then matching uses deep equality without index alignment.
Moves vs edits in nested data
If an object inside an array both moves and changes a field, the engine may report it as one removal on the left and one addition on the right rather than a single “moved” marker. That is normal for tree diff without stable object IDs—focus on whether the highlighted values match your intent.
Numbers, duplicates, and escapes
- JSON.parse may print 1.0 as 1 in pretty output; numeric value is unchanged.
- Duplicate keys in one object: parsers typically keep the last occurrence—compare uses parsed data, not raw duplicate text.
- Unicode escapes and literal characters can compare equal after parse (e.g. \u4f60 vs 你).
Typical use
Before and after an API change
Paste production vs staging responses side by side. Key shuffle from serializers will not noise the diff; array order still matters unless you ignore it.
Config or fixture review
Compare checked-in JSON fixtures when a test fails—spot added keys (green), removed keys (red), or changed values (amber).