Paste two JSON documents to see exactly what changed: every added, removed and modified value with its path. Key order and formatting are ignored, and you can also ignore array order or match array items by an id.
Both documents are pretty-printed with keys sorted, so only real changes are highlighted.
RFC 6902 operations that turn the original into the changed JSON. The patch always describes the exact documents; the ignore options above do not apply to it.
Advertisement
Advertisement
How to use the JSON Compare
Paste the original JSON on the left and the changed JSON on the right, or upload two .json files.
Read the summary: the counts of added, removed and changed values appear instantly.
Browse the differences. Each row shows the path (such as $.users[2].email) and the old and new value. Use the filters to show only one kind.
Set options if needed: ignore array order, match array items by a key like id, ignore keys like updatedAt, or ignore string case.
Switch views to Side by side for highlighted lines, or JSON Patch to copy a patch that turns the left document into the right one.
How the JSON comparison works
Both documents are parsed first, so the tool compares data, not text. Then it walks the two trees side by side:
Objects are compared key by key. A key only on the left is removed, a key only on the right is added. Key order never matters.
Arrays are compared with a longest-common-subsequence algorithm, the same idea used by text diff tools. Inserting one item at the start is reported as one added item, not as every item changing. Arrays of records that all have a unique id (or _id, uuid, key, sku, code) are matched by that field automatically; set your own field in Match array items by key.
Values (strings, numbers, booleans, null) are changed when they differ. If the type differs, for example 1000 became "1000", it is reported as a type change, a common source of API bugs.
Reading JSON paths
Path
Meaning
$
The whole document (root)
$.owner.email
The email key inside the owner object
$.tags[3]
The fourth item of the tags array (indexes start at 0)
$.users[id=2]
The item in users whose id is 2 (when matching by key)
$["first name"]
A key that contains spaces or special characters
/users/0/email
JSON Pointer (RFC 6901), the path style used in JSON Patch
Common uses
API testing: compare a response before and after a deploy. Add updatedAt, requestId to Ignore keys so fields that always change do not hide real regressions.
Config drift: compare package.json, tsconfig.json or deployment configs between branches or environments.
Data migrations: match records by id to see exactly which records changed, appeared or disappeared.
Sync and patches: copy the JSON Patch to send only the changes to a server that supports RFC 6902.
Frequently asked questions
How do I compare two JSON files?
Paste or upload the first file on the left and the second on the right. The tool parses both and compares them value by value, so differences in whitespace, indentation or key order are ignored and only real data changes are listed.
Does key order matter in JSON?
No. In JSON, an object is an unordered set of name/value pairs, so {"a":1,"b":2} and {"b":2,"a":1} are the same data. Array order does matter by default, because [1,2] and [2,1] are different lists, but you can choose to ignore it.
What does 'match array items by key' do?
Arrays of objects such as users or products are often reordered or have items inserted. If every item has a unique field like id, the tool pairs items with the same id and compares them, instead of comparing by position. Changes are then shown as $.users[id=42].email.
What is a JSON Patch?
JSON Patch (RFC 6902) is a standard list of operations, such as add, remove and replace, with JSON Pointer paths like /users/0/email. Applying the generated patch to the left document produces the right document exactly.
Is my JSON uploaded to a server?
No. Both documents are parsed and compared with JavaScript in your browser, so API responses, configs and other private data never leave your device.
Why are 1 and 1.0 shown as equal?
In JSON both are the same number. The comparison works on parsed values, so 1, 1.0 and 1e0 are equal, and "1" (a string) is reported as a type change from number to string.
How large can the JSON files be?
Documents of several megabytes work. Very large arrays use a faster position-based comparison, and the side-by-side view is limited for huge files to keep the page responsive.