Compare two JSON values and see exactly which keys are missing or different.
1
1
How to Use the JSON Compare
Paste the first JSON into "Left JSON".
Paste the second JSON into "Right JSON".
Click "Compare" to see a list of every key that's missing or different between the two.
How the Comparison Works
Both inputs are first parsed with JSON.parse. If either one is not valid JSON, the tool stops and tells you whether the left or the right side failed, so fix that first (the JSON Validator gives a line and column).
The tool then walks both values from the top. Wherever both sides hold an object, it collects the keys from both. A key found only on the right is reported as added, a key found only on the left as removed, and a key present on both sides is examined one level deeper. Wherever the two values are not both objects (strings, numbers, booleans, null, arrays, or an object compared with something else), they are compared as complete values and reported as changed if they differ.
Each difference is listed with its path, built from the keys joined by dots, such as customer.address.pincode. A difference at the very top level, for example two different arrays, is shown as (root). Added and removed are relative to the left side, so it helps to paste the older or expected version on the left and the newer or actual version on the right.
Comparing the left with the right gives four rows:
Path
Type
Left Value
Right Value
amount
changed
1499
1349
customer.pincode
added
(missing)
"411001"
items
changed
["pen","notebook"]
["notebook","pen"]
coupon
removed
"DIWALI10"
(missing)
orderId, name and city are identical, so they are not listed. The items row is worth noticing: both arrays contain the same two products, but in a different order, and array order counts as a difference.
Rules That Affect the Result
Key order inside objects is ignored everywhere, including objects nested inside arrays.
Arrays are compared as one value and their order matters. If a single element differs in a 500-item array, the whole array is reported as one change. To pinpoint it, sort both arrays the same way first, or paste just the suspect elements.
Types are strict. The number 1499 and the string "1499" are different, and so are 1 and true. A key holding null is not the same as a missing key: it is reported as added or removed.
Numbers are compared by value after parsing, so 1.0 and 1, or 1e3 and 1000, count as equal.
Strings must match exactly, including letter case and trailing spaces.
If an object contains the same key twice, only the last value survives parsing, so the earlier value is never compared.
Paths are joined with dots, so a key whose name itself contains a dot looks the same in the path as a nested key.
Where It Helps
Checking an API response before and after a code change or deployment, to confirm only the intended fields changed.
Comparing configuration from two environments, such as staging and production, to find a setting that differs.
Finding keys missing from a translation file, for example an English file against a Hindi one. Every translated value will also appear as changed, so scan the Type column for added and removed rows.
Confirming that reformatting or re-saving a file did not alter its data. If the only difference was whitespace or key order, the tool reports the two values as identical.
Frequently Asked Questions
It parses both inputs and recursively walks through every key, listing any keys that are missing on one side and any values that differ, along with their exact path (e.g. user.address.city).
No, key order is ignored โ only the actual keys and values are compared, matching how JSON objects are treated in most programming languages.
Arrays are compared as whole values at each path; if an array's overall content differs it's reported as a changed value at that path rather than element by element.
Yes. ["pen", "notebook"] and ["notebook", "pen"] are reported as a change, because order is part of an array's value in JSON. If order is not meaningful for your data, sort both arrays the same way before comparing.
No. One is a number and the other is a string, so the tool reports the path as changed. This often reveals a real bug, such as one system sending amounts or IDs as strings while another sends numbers.