Compare JSON Online
Compare two JSON documents and see every changed, added and removed value.
About JSON Compare
Paste two JSON documents side by side and instantly see exactly what changed between them.
- Paste your first JSON document into the left editor, the second into the right.
- Click Compare.
- Differing lines are highlighted in both editors: amber for changed, red for removed, green for added. Use Previous / Next to step through them.
- A summary table below lists every difference: added, removed, or changed values.
- Click Format on either side first if your JSON is minified or messy.
- Key order doesn't matter: objects are matched by key, so reordered keys are not reported. Array order does matter - items are compared by position.
- Large documents (over ~50KB combined) are compared on a background thread automatically, so the editor stays responsive.
- Great for catching unintended changes between two versions of a config file or API response.
JSON Diff: Compare JSON Objects and Files
This JSON compare tool performs a structural diff, not a plain text diff. Both documents are parsed first, so whitespace, indentation and key order never show up as differences - only real changes to keys, values and types do.
How the JSON diff works
- Both inputs are parsed as JSON. If either one is invalid, you get a syntax error instead of a misleading diff.
- Objects are compared key by key. A key that exists only in the second document is reported as Added; one that exists only in the first is Removed.
- Values under the same key are compared recursively. Different values are reported as Changed; a string on one side and a number or object on the other is Type changed.
- Arrays are compared index by index. Extra items are reported as Added or Removed.
Example
Comparing these two JSON objects:
{
"name": "Alice",
"age": 30,
"email": "alice@example.com",
"roles": ["admin"]
}{
"age": 31,
"name": "Alice",
"roles": ["admin", "editor"]
}reports three differences:
age- Changed (30 → 31)email- Removed (only in the first document)roles[1]- Added (only in the second document)
The name key is identical even though it appears in a different position.
When to compare JSON
- Compare two API responses to see what changed between environments or versions.
- Diff JSON config files (package.json, tsconfig, app settings) before deploying.
- Check test fixtures and snapshots against actual output.
- Compare JSON files exported from a database or another tool.
JSON compare FAQ
Does key order matter when comparing JSON?
No. Objects are compared by key name, so {"a":1,"b":2} and {"b":2,"a":1} are identical. Array order does matter, because JSON arrays are ordered.
Is my JSON uploaded to a server?
No. The comparison runs entirely in your browser, so you can safely compare JSON containing private data.
Can I compare large JSON files?
Yes. Larger documents are diffed on a background thread so the page stays responsive. Use the upload button above each editor to open JSON files directly.
What's the difference between JSON compare and JSON diff?
They mean the same thing: finding the differences between two JSON documents. This tool shows them highlighted in both editors and as a table of changes.