JSON diff
What is a Json Diff?
Comparing two JSON documents with an ordinary text diff is frustrating: a different key order or indentation shows up as a change even when the data is identical. A structural JSON diff compares the parsed data instead, and reports exactly which keys were added, removed or changed. It is ideal for checking API responses, configuration files and test fixtures.
How to use it
- Paste the original JSON on one side.
- Paste the new JSON on the other side.
- Review the highlighted differences.
Example
Original:
{ 'name': 'Asha', 'role': 'dev', 'skills': ['go', 'sql'] }New:
{ 'role': 'lead', 'name': 'Asha', 'skills': ['go', 'sql', 'k8s'], 'team': 'core' }(Real JSON uses double quotes.) The diff reports: role changed from dev to lead, skills[2] added with value k8s, and team added. The different key order is ignored.
Things to know about JSON comparison
- Object key order does not matter; JSON objects are unordered.
- Array order does matter.
[1, 2]and[2, 1]are different arrays. Sort arrays first if order is irrelevant for your data. - Types matter:
1and'1'are different values. - Numbers are compared as numbers, so
1.0and1are equal after parsing.
Typical uses
- Spotting unexpected changes between two API versions.
- Reviewing configuration drift between staging and production.
- Debugging failing snapshot tests.
Both documents are compared locally in your browser.
Frequently Asked Questions
Does key order affect the comparison?
No. JSON objects are unordered, so keys in a different order are treated as identical.
Does array order matter?
Yes. Arrays are ordered, so the same items in a different order count as changes.
Why use a JSON diff instead of a text diff?
A JSON diff ignores formatting and key order and shows only real data changes.
Is my JSON sent to a server?
No. The comparison runs entirely in your browser.