How to use
- Paste the original JSON on the left and the changed JSON on the right.
- Every added, removed and changed key appears in the list below, by key path.
- Reordering keys or re-indenting either side never shows as a change.
- Narrow the list with the Added, Removed and Changed chips, switch to Side by side to see both documents formatted and aligned, or copy the change list.
Structural diff, not text diff
Two JSON documents can be byte-for-byte different and mean exactly the same thing: different key order, different indentation, a trailing newline. A text or line diff sees all of that as "changed." This tool parses both sides first and compares the resulting values by key path, so only an actual difference in meaning, a key added, removed or holding a different value, ever shows up.
Example
The shared sample pair reports exactly these changes:
$.tags[1]
$.address.postcode
$.address.country
$.verified
$.activeAn object with reordered keys reports zero changes:
{"a":1,"b":2} vs {"b":2,"a":1}
-> 0 changesOptions explained
- Original JSON / Changed JSON: any valid JSON value, not just objects (arrays and bare primitives work too).
- Original JSON / Changed JSON boxes: coloured as JSON while you type (keys, strings, numbers,
true/falseandnulleach in their own colour), and when one side does not parse, its line numbers mark the failing line in red. Each box has its own Paste button next to its character count; boxes over 100,000 characters stay plain so typing stays instant. - Swap sides: exchanges Original and Changed. Clear both empties both boxes.
- Changes / Side by side: the change list by key path (filter it to one kind of change with the chips above it), or both documents reformatted with 2-space indent and aligned line by line, with changed lines marked and long unchanged stretches folded. Side by side is a text comparison of the formatted output, so unlike the change list it can show a moved key as a removal plus an addition. It needs a wide screen; phones show the change list.
Edge cases and common errors
- Identical documents (including ones that only differ in key order or whitespace) report "No differences," not an empty, ambiguous list.
- A key present with value
nullis distinguished from the key being entirely absent: removing anull-valued key is reported as removed, withnullas its value. - A non-identifier key name like
"a b"is shown bracket-quoted in the path ($["a b"]) rather than as an invalid$.a b. - Extremely deeply nested documents (several thousand levels) are refused with a clear message rather than crashing the tab, the same limit the JSON Formatter uses.
Do the same thing in code
// JavaScript: a quick structural diff for simple cases
function deepEqual(a, b) { return JSON.stringify(a) === JSON.stringify(b); }
// Note: this is order-sensitive for object keys unless you sort them first,
// and doesn't tell you *what* changed the way this tool's key-path list does.Comparing plain text or source code instead of JSON? The Text Diff Checkerhandles line and word-level changes, with basic syntax highlighting for common languages.