What is JSON diff?
A plain text diff shows many changes when only the formatting, indentation or key order differ. This tool parses both sides as JSON first and lists only the data that really changed, for example an API response before and after a release, or the configuration of two environments.
How to use
- Paste the original JSON on the left and the changed JSON on the right. With "Compare as you type" on, the differences appear right away.
- Each difference shows its type (added, removed, changed) and JSON path, such as
$.order.items[0].price. - Click a difference to highlight it on both sides. "Copy report" copies a text version for a pull request or a document.
How JSON is compared
- Objects by key: a different key order is not a difference.
- Arrays by position: the first item is compared with the first item, so a different order shows as changes.
- Numbers by value:
1.0equals1and1e2equals100, and large numbers keep full precision. Turn the option off to compare the exact text. - Strings by content:
"中"equals"中".
Example
Original {"name":"Keyboard","price":980.00,"tags":["office","usb"]}, changed {"price":980,"name":"Keyboard Pro","tags":["office","bluetooth"],"color":"black"}. The report is:
~ $.name: "Keyboard" → "Keyboard Pro" ~ $.tags[1]: "usb" → "bluetooth" + $.color: "black"
price went from 980.00 to 980, which is the same value, so it is not listed.
FAQ
What do +, - and ~ mean in the report?
+ is a field added on the right, - is a field removed on the right, and ~ is a field on both sides with different values: the original value is left of the arrow and the new value is on the right.
Why does a reordered array show many differences?
Arrays are ordered in JSON: [1, 2] and [2, 1] are different data, so every position is compared. If the order does not matter, sort the array in the program that produces the JSON before comparing.
What if one side is not valid JSON?
The message says which side is wrong and gives the line and column; click "Go to error" to find it. Missing or extra commas can be fixed with "Repair" in the JSON Formatter.