JSON Diff
Paste two JSON documents and see which keys were added, removed, or changed, listed with paths such as $.user.name. Unlike a text diff, differences in key order or indentation do not count. Useful for checking an API change or comparing config files. For a line-by-line comparison, use the Text Diff tool.
🔒 Runs in your browser · Your data is never sent to a server
Differences
Notes
- Objects are compared without regard to key order. Arrays are compared item by item at the same position (index) by default.
- With "Ignore array order" on, items with the same value are matched up. Items that cannot be matched are reported as removed and added, even if only part of the item differs.
- Numbers are compared as JavaScript numbers: 1 and 1.0 are the same, but 1 and "1" (a string) are different.
- Only the two pasted JSON documents are compared, entirely in your browser. JSON that contains tokens or other secrets is never sent anywhere.
Glossary
Path
Notation for where a changed value lives. $ is the root, .name is a key, and [0] is an array index.
Structural comparison
Comparing JSON as a structure of objects, arrays, and values rather than as text. Differences in key order, spaces, or line breaks do not count.
Array index
The number that gives an array element its position. It starts at 0, so [0] is the first element.
FAQ
Does a different key order count as a difference?
No. Object keys are compared without regard to order, matching values by key. Formatting differences such as indentation and line breaks do not count either.
What if array items are in a different order?
By default, items at the same position are compared, so a reordered array shows as changes. Turn on "Ignore array order" to match items by value; a pure reorder then produces no differences.
How do I read the paths in the results?
$ is the root of the whole document. $.user.name is the name key of the user object, and $.items[2] is the third element of the items array. Keys that are not plain identifiers, such as ones with hyphens, appear as $["first-name"].
Can it compare large or deeply nested JSON?
JSON up to a few megabytes compares fine in the browser. If the nesting is extremely deep, an error message tells you it cannot be processed.
Share this page
