JSON Compare
Compare two JSON documents by meaning: key order ignored, arrays matched by key, every change listed by path.
Paste, type or open two JSON documents to see what changed.
Paste or open two JSON documents and see how they differ in meaning, not in layout. Key order and spacing never count as changes; every real difference is listed by its JSON Pointer path, with the value before and after and a link to its line in each document.
It suits comparing API responses, configuration files and test fixtures. The comparison runs in your browser, and neither document is sent anywhere.
Options
- View — Changes lists each difference by path. Side by side shows both documents written out the same way — keys sorted, ignored keys left out, numbers in one form, and matched array items in the same order — and compares them line by line, so the view shows what the list lists. Its line numbers are those of this normalised form, not of your input.
- Arrays: By position — the default: item 0 is compared with item 0, item 1 with item 1, and so on.
- Arrays: By key — items are paired by the value of one key, such as
id, wherever every item on both sides is an object holding that key with no value repeated. A paired item that changed place is listed as Moved. The Key list offers the keys that can pair arrays in your documents. Arrays the key cannot pair are compared by position, and a note names them. - Arrays: Ignore order — arrays are compared as collections: an item counts as unchanged if an equal item is anywhere in the other array, and repeats are counted. An item that changed has no equal partner, so it shows as Removed plus Added.
- Ignore keys — a comma-separated list. A plain name such as
updatedAtignores that key at any depth; an entry starting with/is a JSON Pointer to one place, such as/meta/requestId. - Treat 1, 1.0 and 1e0 as equal — on by default: numbers compare by value, exactly, however they are written. Off, they must be written the same.
- Ignore case in strings — string values compare without regard to capital letters, including ß and ss. Keys always keep their case.
- Wrap long lines — long lines wrap in the two boxes, useful for minified JSON. Wrapped boxes show no line numbers and do not mark the line of a syntax error.
The line buttons on each change select that line in the document it belongs to. The options are remembered on this device, and Reset options puts them back to their defaults.
The ignore options change what the list counts as a change. They never change the JSON Patch, which always records every difference — numbers as written, case kept, no key ignored — so applying it to the original gives the changed document exactly. Copy JSON Patch copies it, and Download saves it as a.patch.json file. The array mode only shapes the patch: items paired by key or ignoring order are moved rather than removed and added again.
Each document can be up to 2 MB and 50,000 lines. A syntax error is named with its line and column under its box. A key written twice in one object is allowed, as in JavaScript, where the last value wins; a note under the box names it.
Comparing JSON by meaning
A text diff compares lines, so it reports reordered keys, re-indented files and a number written as 1.0 instead of 1 as changes, and misses that nothing in the data moved. This tool reads both documents as JSON and walks them together: objects are matched key by key, values by type and content, and arrays by the chosen mode.
Numbers are compared as exact decimals, never as floating point, so 9007199254740993 and 9007199254740992 differ, as they should, even though JavaScript reads both as the same number. Paths follow RFC 6901: a / inside a key is written ~1 and a ~ is written ~0. A change is located by its path in the changed document, and a removal by its path in the original.
Examples
An API response, reordered and edited
- Original JSON
{ "id": 42, "name": "Desk lamp", "price": 19.90, "tags": ["home", "light"] }- Changed JSON
{ "name": "Desk lamp", "id": 42, "price": 21.5, "tags": ["home", "light", "sale"], "stock": 12 }- Result
- 2 added · 1 changed
- Changes
Changed /price: 19.90 → 21.5 Added /stock: 12 Added /tags/2: "sale"
With the default options, the swapped keys are not a change, and the price is compared as a number.
An item inserted at the top of an array
- Original JSON
{ "items": [ { "id": "a1", "qty": 1 }, { "id": "b2", "qty": 3 } ] }- Changed JSON
{ "items": [ { "id": "c3", "qty": 2 }, { "id": "a1", "qty": 1 }, { "id": "b2", "qty": 4 } ] }- Arrays: By position
1 added · 4 changed Changed /items/0/id: "a1" → "c3" Changed /items/0/qty: 1 → 2 Changed /items/1/id: "b2" → "a1" Changed /items/1/qty: 3 → 1 Added /items/2: {"id":"b2","qty":4}- Arrays: By key (id)
1 added · 1 changed Changed /items/2/qty: 3 → 4 Added /items/0: {"id":"c3","qty":2}
By position, the new first item shifts every later one, so each looks changed. Paired by id, the result is what happened: one item added, one quantity changed.
Two responses with volatile fields
- Original JSON
{ "status": "ok", "updatedAt": "2026-10-01T09:00:00Z", "meta": { "requestId": "7f3a", "page": 1 }, "user": { "name": "Asha", "updatedAt": "2026-09-30T18:12:00Z" } }- Changed JSON
{ "status": "ok", "updatedAt": "2026-10-02T11:30:00Z", "meta": { "requestId": "c91e", "page": 1 }, "user": { "name": "Asha", "updatedAt": "2026-10-02T11:29:58Z" } }- With the default options
- 3 changed
- Ignore keys: updatedAt, /meta/requestId
- No differences
Timestamps and request ids change on every call. The name updatedAt ignores both copies of that key, and the pointer ignores the request id only where it sits.
The JSON Patch for a small edit
- Original JSON
{"name": "Desk lamp", "price": 19.90}- Changed JSON
{"name": "Desk lamp", "price": 21.5, "stock": 12}- JSON Patch
[ { "op": "replace", "path": "/price", "value": 21.5 }, { "op": "add", "path": "/stock", "value": 12 } ]
Each operation names a path and what to do there. Applied in order to the original, they give the changed document.
Frequently asked questions
PATCH requests, which update a resource without sending the whole document, and libraries in most languages apply it. It also records a change to a configuration or test fixture precisely.See also
- JSON Formatter & Minifier — to format or validate a single JSON document.
- Text Compare & Diff Checker — to compare JSON as text, line by line, when its layout matters.
- JSON Schema Validator — to check a document against a schema rather than another document.