How to use the JSON Diff
- Paste the original JSON on the left and the new version on the right (or drop two files).
- Both sides are parsed; if either is invalid you see the line and column of the problem.
- Read the change list: each entry shows the path, the kind of change and the old and new value.
- Click a change to jump to it in both panes, then copy the summary for a code review or ticket.
Worked example
Two versions of a user record
Left (before)
{"id":7,"name":"Ada","roles":["admin"],"active":true}Right (after)
{"name":"Ada L.","id":7,"roles":["admin","dev"],"email":"ada@example.com"}Changes
changed $.name "Ada" → "Ada L." added $.roles[1] "dev" removed $.active true added $.email "ada@example.com"
id moved from first to second position but is not reported: object key order has no meaning in JSON. Array positions do matter, so roles[1] is an addition.
Text diff vs. structural JSON diff
| Situation | Line-based text diff | Structural JSON diff |
|---|---|---|
| Keys reordered | Reports many changed lines | No change |
| Indent changed from 2 to 4 spaces | Every line differs | No change |
| 1.0 vs 1 | Different text | Compared as numbers |
| Value changed deep in a nested object | Shows the line, not the path | Shows the exact path, e.g. $.a.b[2].c |
| Element inserted at the start of an array | One added line | Later elements compared by index, so several may show as changed |
How arrays are compared
Arrays are ordered in JSON, so the diff compares them index by index. Inserting one item at the front of a list shifts everything after it, which can make a short edit look like many changes. If your array is really a set of records with IDs, sort both sides by that ID first (the JSON formatter's sort tools help) and then diff.
Strings are compared exactly, including case and whitespace. A trailing space in a value is a real change and will be reported.
When the diff refuses to run
Both inputs must be valid JSON. API logs often contain single quotes, trailing commas or comments; repair them first, then paste the cleaned output back in. Very large inputs are compared in a background worker so the page stays responsive.
JSON Diff FAQ
Does key order matter when comparing JSON?
No. RFC 8259 defines objects as unordered collections of name/value pairs, so {"a":1,"b":2} and {"b":2,"a":1} are equal and the diff reports nothing.
Why does my array show many changes when I only added one item?
Arrays are compared by position. Adding an element at index 0 shifts every later element, so each index now holds a different value. Append to the end, or sort both arrays by a stable key before comparing.
Can I compare two JSON API responses?
Yes. Copy each response body from your browser's network panel or from curl and paste them into the two panes. Volatile fields such as timestamps and request IDs will show up as changes, which is expected.
Is 1 the same as 1.0 in a JSON diff?
Numerically yes, and the diff treats them as equal numbers. If you need byte-level equality, compare the raw text instead.
How do I diff two JSON files from the command line?
A common approach is jq with sorted keys on both files, then a normal diff: diff <(jq -S . a.json) <(jq -S . b.json). This tool gives the same result without installing anything and shows changes by path.
Related tools
- JSON formatter – indent both sides first – consistent indentation for manual review
- JSON fixer – repair a side that will not parse
- JSONPath tester – pull one field from each version – narrow a big diff down
- JSON Schema validator – check the new version

