DEVELOPER & DATA

JSON Diff

Compare two JSON documents structurally — added, removed and changed values with JSON Pointer paths, key order ignored — and get a JSON Patch between them.

A change list (+ added, − removed, ± changed with old and new values, type changes marked), counts, an optional key-order check, and an RFC 6902 JSON Patch to copy.

Example: {"a":1,"b":[1,2,3]} → {"a":2,"b":[1,3],"e":"new"} gives ± /a 1 → 2, ± /b/1 2 → 3, − /b/2, + /e, and a four-operation patch with the array removal applied first.

v0.1.0 · last reviewed 20 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

Compared as values,
not as text.

What is compared and how, what the paths and patch mean, and why arrays are matched by index.

Comparison

Both documents are parsed, so whitespace and key order do not matter (key order can be reported on request). Objects are matched key by key, arrays element by element at the same index, and leaves by strict equality: 1 and 1.0 are the same number, "1" and 1 differ and are reported as a type change.

Paths and patch

Each difference carries a JSON Pointer path (RFC 6901, with / and ~ escaped as ~1 and ~0). The same list is written as a JSON Patch (RFC 6902) of add, remove and replace operations that turns the left document into the right one, with array removals ordered from the highest index so they apply cleanly.

Arrays by index

Inserting an element near the start of an array shifts everything after it, so the diff reports every later element as changed. That is faithful to what a patch has to do; it is not a smart alignment of "moved" items. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.

SOURCES

Last reviewed 20 September 2026. How results are checked: How we verify.