JSON Diff Viewer
Compare two JSON documents with semantic diff highlighting and detailed change detection.
JSON Diff Viewer tool
Example
Input: JSON A {"name":"Ada","age":36} and JSON B {"name":"Ada","age":37,"admin":true}
Result: 2 differences: Added $.admin (true); Changed $.age (36 to 37)
The documents are compared as data, so key order does not matter. Each difference is listed by its JSONPath location.
How Differences Are Reported
| JSON A | JSON B | Result |
|---|---|---|
| {"a":1,"b":2} | {"b":2,"a":1} | Identical |
| {"n":1} | {"n":1.0} | Identical |
| {"n":1} | {"n":"1"} | changed $.n |
| {"x":null} | {} | removed $.x |
| {"u":{"roles":["a"]}} | {"u":{"roles":["a","b"]}} | added $.u.roles[1] |
| {"first name":"A"} | {"first name":"B"} | changed $["first name"] |
| [1,2,3] | [0,1,2,3] | changed $[0], $[1], $[2]; added $[3] |
Output of this viewer's semantic comparison.
- Paste the first JSON document into the JSON A panel.
- Paste the second JSON document into the JSON B panel.
- The tool performs a semantic comparison as you type and shows the total number of differences, or confirms the documents are identical.
- Review the Changes by Path list, where each added, removed, or changed value is labeled and color-coded with its old and new value.
- Scroll to the Line Diff to see both documents line by line with added lines in green and removed lines in red.
- If a document is not valid JSON, fix the error shown under its panel - until then the tool falls back to a plain text line diff.
Comparing JSON by Structure, Not Text
A JSON diff compares two documents as data rather than as lines of text. This viewer lists every value that was added, removed or changed, each with its JSONPath location such as $.user.roles[1]. Differences in key order and whitespace are ignored.
A plain text diff flags a change when keys are reordered or the indentation differs, even though the data is the same. Here both documents are parsed, their keys are sorted, and the values are compared. {"a":1,"b":2} and {"b":2,"a":1} are reported as identical. A change of type does count, though: 1 and "1" are different values, while 1 and 1.0 are the same number.
Arrays are compared position by position. That is simple and predictable, but it has a side effect. Inserting one item at the start of a list shifts everything after it, so each later position shows as changed and the last one as added. Keep that in mind when you compare lists of records. The table shows how common cases are reported.
Results update as you type. The Changes by Path list shows up to 500 differences with the old and new values; added entries are green, removed ones red and changed ones amber. Below it, a line diff shows both documents after key sorting. If either side is not valid JSON, the error appears under that panel and the tool falls back to a plain text diff. For ordinary text, use Text Diff and Compare.
Sources
Frequently Asked Questions
Related Tools
JSON Formatter and Validator
Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.
Developer ToolsJSON Minifier
Minify JSON by removing whitespace and formatting for compact, production-ready output.
Developer ToolsJSON to YAML Converter
Convert JSON documents to YAML format with syntax validation, clean formatting, and instant preview.
Developer ToolsJSON to CSV Converter
Convert a JSON array of objects to CSV with automatic column headers, and convert CSV back to JSON in the same tool.
Developer Tools