JSON Diff
Compare two JSON documents structurally: added/removed keys, changed values and type changes with exact paths, ignoring key order.
See JSON field additions, removals, value changes, and type changes at a glance
What is the difference between JSON Diff and text comparison?
JSON Diff parses two JSON documents into objects and compares them recursively. It reports semantic structural differences only, with a JSONPath location, change type, and before-and-after values for each difference.
Different object key order is not treated as a difference
A regular text comparison would treat {\"a\":1,\"b\":2} and {\"b\":2,\"a\":1} as different because the character order is different. Semantically, however, these two JSON objects are identical. JSON Diff compares values by field name, so changing object key order does not produce any difference entries.
Four types of differences can be detected
The tool identifies additions (fields present in B but not A), removals (fields present in A but not B), value changes (different values at the same path), and type changes (for example, the number 18 becoming the string \"18\"). Array elements are compared by index, while nested objects and nested arrays are compared recursively. The difference list can be copied as plain text using the four prefixes + / - / ~ / !.
How to read the results
The result table has four columns: path, type, JSON A value, and JSON B value. Paths use JSONPath notation, such as $.user.name or $.list[0].id. The complete difference JSON below organizes each difference into a structured array that can be copied and shared with developers to locate changes. The summary shows the number of differences and the counts of additions, removals, changes, and unchanged values. Type changes are marked separately rather than being combined with value changes.
Two comparison options
Ignore array order compares arrays as sets, so [1,2] and [2,1] are considered equal. This is useful for tags or permission lists where element order has no meaning. Ignore surrounding string whitespace removes differences caused by spaces or line breaks at the beginning and end of strings, which is useful when comparing configurations with different formatting. Changing either option immediately runs the comparison again and only changes the comparison rules; it does not modify either input.
How to compare local files
Switch to the file upload tab and drag two .json files into the left and right drop zones, or select the files individually. The files are read locally in the browser with FileReader, with a 10 MB limit per file. Once both sides are loaded, the comparison starts automatically without another button click. The file contents never leave the browser.
Common causes of differences
An API field rename appears as a removal and an addition at the relevant paths. A changed default value appears as a value change. Mixing a Boolean and a string, such as true and the string \"true\", is identified as a type change. Array reordering produces individual differences when Ignore array order is disabled. Start by checking the path to locate the field, then check the type and value to identify the cause. If the two documents are completely identical, the result area directly reports that there are no differences instead of showing an empty table.
Does JSON Diff ignore object key order?
JSON Diff parses both JSON documents into objects and compares them recursively, so different object key order does not produce difference entries. It reports actual field additions, removals, value changes, and type changes.
Each difference includes a JSONPath location, such as $.user.name, which can directly point to an API field or source location.
- Parses before comparing, so different object key order is not treated as a difference
- Identifies additions, removals, value changes, and type changes, with a JSONPath location for each
- Arrays can optionally be compared as sets, so [1,2] and [2,1] are considered equal
- Difference lists can be copied as plain text with the + / - / ~ / ! prefixes
- Uploaded files are limited to 10 MB each, and comparison starts automatically after both sides are loaded
- Everything runs locally in the browser, and input data is not uploaded to the server