JSON Compare
Compare two JSON files with a semantic, key-aware diff.
About the JSON Compare Tool
What is a JSON compare tool?
A JSON compare tool takes two JSON documents and shows you exactly what changed between them. Paste both versions and this one gives you two complementary answers at once: a structural comparison that lists every added, removed, and changed value with its full path — like $.address.zip: "02101" → "02102" — and a classic side-by-side text diff with the changed lines and words highlighted.
What makes it genuinely JSON-aware is that it understands the data, not just the text. Key order doesn't matter in JSON, so with Sort object keys on, two files containing the same data in a different order are reported as semantically identical instead of drowning you in false differences. Both documents are validated as you type, everything is formatted consistently before comparing, and it all runs in your browser — your data is never uploaded.
How to Use This Tool
- Add both documents. Paste the original JSON on the left and the changed version on the right, drag files onto the boxes, or use the Open buttons. Click Sample to see it in action.
- Check the badges. Each pane shows a live Valid JSON badge — or the exact parse error if something is malformed.
- Read the structural panel. Every difference is listed with its path and the old and new values, tallied into added, removed, and changed counts.
- Scan the text diff. Below it, the formatted side-by-side view highlights the same changes line by line; switch to inline for a Git-style view.
- Export. Copy the diff to your clipboard or download it as a standard
.difffile.
Common Use Cases
- Comparing API responses: See exactly which fields changed between two calls, without noise from key ordering.
- Reviewing config changes: Diff
package.json,tsconfig.json, or app settings before and after an update. - Debugging serialized state: Find the one property that differs between a working payload and a broken one.
- Validating migrations: Confirm an export/import or database migration really produced the same data.
- Contract testing: Check whether a new service version still returns the structure the old one did.
Need to tidy a single document instead? Try our JSON Formatter or JSON Sorter, or compare plain text with the Text Compare tool.
Frequently Asked Questions
What does "semantically identical" mean?
It means both documents contain exactly the same data even if the text differs. JSON key order carries no meaning, so {"a":1,"b":2} and {"b":2,"a":1} are the same object. With Sort object keys enabled, the tool normalizes both sides and tells you when only the ordering or formatting differs.
What do the paths in the structural panel mean?
They pinpoint where each change lives, in JSONPath-like notation: $ is the document root, $.user.name is the name key inside the user object, and $.items[2] is the third element of the items array. Keys with spaces or special characters are shown in bracket form, like $["my key"].
How are arrays compared?
Element by element, by position, because array order is meaningful in JSON. If you insert an item in the middle, the structural panel reports the positions that changed from that point on, and the text diff usually shows it more compactly as a single added line.
Can I compare invalid JSON?
Yes. If either side fails to parse, its badge shows the exact error and the tool falls back to a plain text comparison, so you can still see what differs. The structural panel needs two valid documents to appear.
Does formatting or whitespace affect the result?
No. With Format JSON enabled (the default), both documents are re-printed with identical two-space indentation before the text diff runs, so a minified file and a pretty-printed file with the same content compare as identical.
Is my JSON private?
Completely. Parsing, comparison, and formatting all run in your browser with JavaScript. Nothing you paste is uploaded, stored, or logged, and the tool keeps working offline once the page has loaded.