Free tool
JSON diff.
Two configs, two API responses, two exports — and a text diff that lights up every line because the keys came back in a different order. This compares the data, not the text: every path that was added, removed or changed, with the values side by side, and the same edit as a JSON Patch you can apply.
Differences
| Change | Path | Before | After |
|---|---|---|---|
| Changed | $.version | "2.13.0" | "2.14.0" |
| Changed | $.env | "staging" | "production" |
| Changed | $.replicas | 2 | 6 |
| Added | $.features[2] | "klarna" | |
| Changed | $.checks[id="migrations"].timeout_ms | 30000 | 45000 |
| Added | $.checks[id="canary"] | {"id":"canary","timeout_ms":60000} | |
| Removed | $.owner.oncall | "dana" |
Turns the change list into a link for whoever has to sign off on the config change — they comment on the exact path they are questioning, and the patch rides along. Free, no card.
Why a line diff gets JSON wrong
A JSON object has no key order, but text does. Serialise the same object from two languages, or from the same API on two days, and the keys can come back shuffled — a line differ then reports half the file as changed. The same happens when one side is minified. Comparing the parsed values instead makes both kinds of noise disappear, so the sample above reports the version bump, the new environment, the extra replica count and the added check, and nothing else. For markup or plain text, the HTML diff is the right tool.
What it reports
- Every difference as a path —
$.owner.oncallremoved,$.replicaschanged from 2 to 6 — written in the same JSONPath notation the JSON viewer copies. - Arrays of records matched by their id, so a new item at the top of a list is one addition, not every index after it.
- Type changes — a number that came back as a string is a change, not a match.
- The whole difference as a JSON Patch: add, remove and replace operations that turn the left document into the right one.
When the JSON is a report, not a config
If what you are comparing is this week's numbers against last week's, the comparison is usually the thing someone else needs to see. Turn the data into a table or a chart and publish it on Comma: every re-publish keeps the previous revision, readers comment on the figure they are asking about, and an agent can read those comments back over the MCP server.
Questions
- How do I compare two JSON files?
- Paste one document into each pane, or drop a .json file onto either. The comparison is structural: you get a list of every path that was added, removed or changed, with the old and new value side by side. Key order and indentation are ignored, so two files that only differ in formatting come out identical.
- Does key order matter?
- No. JSON objects are unordered, so {"a":1,"b":2} and {"b":2,"a":1} are reported as identical. Array order does matter — [1,2] and [2,1] are different documents — unless the items carry an id, in which case see the next question.
- How are arrays of objects compared?
- If every item in both arrays has a unique id-like field (id, _id, uuid, key, slug, name or code), items are matched by it — so inserting a record at the top, or reordering the list, reports only what really changed, labelled like $.checks[id="smoke"]. Without such a field, items are aligned the way a line diff aligns lines, so an insertion is one added item rather than every later index shifting. Turn off “Match array items by id” to force position-by-position matching.
- What is the JSON Patch tab?
- The same difference written as an RFC 6902 JSON Patch: a list of add, remove and replace operations with JSON Pointer paths. Applying it to the left document produces the right one. It is the format PATCH endpoints, Kubernetes and most JSON libraries accept, so you can hand it straight to code or an agent.
- Is 1 the same as 1.0, or "1"?
- 1 and 1.0 are the same number in JSON and compare equal. "1" is a string and is reported as changed from 1 — a type change is usually exactly the bug you are looking for.
- Can it compare NDJSON / JSON Lines?
- Yes. If a side is not one JSON document but every line parses on its own, it is read as an array with one item per line and compared like any other array.
- Is my JSON uploaded anywhere?
- No. Both sides are parsed and compared in your browser. They only leave your machine if you click “Publish this diff” and create a report.
Related: JSON formatter · JSON viewer · HTML diff · YAML to JSON · What is JSON Patch? · all free tools