JSON Diff
Compare two JSON documents by what they mean, not how they're written. Key order, whitespace and number formatting (1.0 vs 1) are ignored, arrays of records are matched by their id, and every real change is listed with its path.
Original
Changed
Differences
Why compare JSON semantically?
A text diff compares characters, so two JSON files that hold exactly the same data can look completely different: an API that returns keys in a different order, a formatter that changed the indentation, 25.50 written as 25.5, or "café" written as "café". This tool parses both documents first and compares the values, so only real changes show up. It's useful for comparing API responses between environments, checking what a migration changed in a config file, reviewing snapshot test failures, or comparing Terraform, Kubernetes and package-lock JSON.
How arrays are compared
- Match by id (default): when every item in an array is an object with a unique
id,_id,uuid,key,code,sku,slugorname, items are paired by that field, so a reordered list of records shows only the fields that really changed. Type a field name to choose it yourself. Other arrays are compared in order. - In order: position matters. The tool finds the longest common sequence of items (like
git diffdoes for lines), so inserting one item at the top shows one addition instead of every item changing. Items that only changed position are reported as moves. - Any order: arrays are treated as unordered lists, which suits tags, roles and permission lists. Items that are mostly alike are shown as one changed item.
Ignoring keys
List keys to skip, separated by commas. A plain name such as updatedAt is ignored at any depth. A dotted path such as meta.requestId starts at the root, and * matches any part of a name or any one level (*.etag, items.*At). Array positions are skipped in paths, so orders.total means the total of every order. Ignored keys are greyed out in the diff view and left out of the patch.
The JSON Patch output
The patch tab gives the same changes as a standard JSON Patch (RFC 6902), which libraries in most languages can apply, and which kubectl patch --type json accepts. For example:
[
{"op": "replace", "path": "/email", "value": "ada.lovelace@example.com"},
{"op": "add", "path": "/roles/2", "value": "billing"}
]
When arrays are matched by id or in any order, new items are added at the end (/-), so the patched array holds the same items but may be in a different order.
Numbers, comments and duplicate keys
- Numbers are compared by exact decimal value:
1,1.0and1e0are equal. Large integers such as 64-bit ids (9007199254740993) are compared digit for digit, whileJSON.parsewould round them and could hide a change. - Comments (
//and/* */) and trailing commas are accepted, so you can comparetsconfig.jsonor VS Code settings files. - If a key appears twice in one object, you get a warning. Like
JSON.parse, the tool uses the last value.
Is my data safe?
Yes. Both documents are parsed and compared by JavaScript in your browser. Nothing you paste or open is uploaded, so it's fine to compare responses that contain tokens or customer data. Only your option choices are saved on this device.