🔀 JSON Diff / Compare
Paste two JSON documents to see exactly what changed, a key-aware diff that ignores reformatting and key order.
3 changes: 1 added, 0 removed, 2 changed
- ~ roles[1]: "user" → "editor"
- ~ active: true → false
- + age: 36
Everything runs in your browser, nothing is uploaded.
How the json diff / compare works
The tool parses both JSON documents and walks them recursively, comparing by key rather than by line. It reports each difference as added (a key or element only in the second), removed (only in the first) or changed (different values), with the path to each. Because it compares the parsed data, reordering an object's keys or reformatting the whitespace is correctly reported as no change, unlike a plain text diff.
A line-based text diff of two JSON files is noisy: pretty-printing or reordering keys shows up as dozens of false changes. A structural (semantic) diff cuts through that to the differences that actually matter, which is what you want when comparing an API response before and after a change, or two config files. Arrays are compared by position, so element order does matter there.
Frequently asked questions
How is this different from a normal text diff?
A text diff compares lines, so reformatting or reordering keys creates false differences. This compares the parsed JSON by key, so only real structural changes, added, removed or changed values, are reported.
Does key order matter?
No for object keys, {"a":1,"b":2} and {"b":2,"a":1} are identical. Yes for arrays: elements are compared by position, so reordering a list is reported as changes.
What does it show for each difference?
The path to the value (e.g. user.roles[2]) and whether it was added, removed or changed, with the old and new values for changes. There's a plain-text summary you can copy.
What if my JSON is invalid?
The tool tells you which side failed to parse so you can fix it. Both must be valid JSON before it can compare them.
How are nested objects and paths reported?
The diff descends into nested objects and arrays, and each change is reported at its full path, for example user.address.city or items[1].price, so you can see exactly where two documents diverge rather than just that they differ somewhere.
Does 1 differ from "1" in a comparison?
Yes. JSON distinguishes types, so the number 1 and the string "1" are reported as a change, as are true versus "true" and null versus an empty string. The comparison is type-aware, matching how a strict parser would treat the values.
Is my data uploaded?
No, both documents are parsed and compared in your browser. Nothing is transmitted, so even sensitive API payloads stay on your device.