How to compare JSON
- Paste or drop the first JSON on the left and the second on the right. Format tidies a minified document.
- The list of differences appears below: each changed, added or removed value, with its path and both values.
- Switch to Side by side to see both documents formatted the same way, with changed lines highlighted.
- Copy the list or download it as CSV.
How differences are found
- Key order does not matter.
{"a":1,"b":2}and{"b":2,"a":1}are the same data, so they show no difference. If only the order differs, the summary says so. - Paths show where each difference is:
$is the top,.namea key and[2]the third item of an array (counting from 0). Keys with spaces or symbols are written["my key"]. - Arrays are lined up by content, so inserting one item at the start does not mark every later item as changed.
When an item was edited, its fields are compared one by one. An index like
[1→2]means item 1 on the left lines up with item 2 on the right. - Ignore the order of array items treats arrays as sets:
["a","b"]and["b","a"]match. Use it for lists of tags, IDs or permissions. - Long numbers are exact. IDs longer than 15 digits, such as
12345678901234567890, are compared digit by digit. Tools that read JSON with JavaScript's standard parser round them, so two different IDs can look equal there. Why this happens. - Types count:
1and"1"are different, and the list says the type changed.1and1.0are the same number.
Invalid JSON
If a document cannot be read, the error says where (line and column) and gives a hint for the two most common
mistakes: a comma before } or ], and single quotes instead of double quotes.
Related tools
Guides
- How text compare works: the diff algorithm and how to read a patchHow diff tools find the changes between two texts: the Myers algorithm behind GNU diff and Git, word highlighting, and how to read a unified diff.
- Comparing JSON correctly: key order, duplicate keys and numbers over 2^53What the JSON standard says about key order, duplicate keys and number precision, and why a comparison built on JSON.parse misses changed IDs over 2^53.
Questions
Does key order matter when comparing JSON?
No. JSON objects have no order, so keys in a different order are not a difference.
Can I compare JSON arrays regardless of order?
Yes. Turn on Ignore the order of array items.
Is my JSON sent to a server?
No. Parsing and comparing happen in your browser. Nothing is uploaded.
Does it handle large IDs over 2^53?
Yes. Numbers with more digits than JavaScript can hold exactly (above 9,007,199,254,740,991) are kept as written and compared digit by digit, and the summary says how many it found.
Can I export the differences?
Yes. Copy gives one difference per line (change, path, old value, new value, separated by tabs). Download CSV opens in Excel.