What is a JSON diff?
A JSON diff compares two JSON documents by structure instead of by text alone. It identifies added and removed properties, changed values and types, and differences inside nested objects or arrays.
This makes it useful for reviewing API responses, configuration files, test output, and data migrations without treating indentation or object key order as changes.
How to compare two JSON files
- Paste or open the original JSON in Original JSON.
- Add the new version to Modified JSON.
- Select Compare JSON, then review the summary and changed paths.
Both editors validate strict JSON. Select a diagnostic to jump to the relevant line and column. You can also format, swap, clear, copy, download, or drag a .json file onto either editor.
JSON diff example
Original JSON:
{
"name": "API",
"version": 1,
"deprecated": false,
"features": ["format", "validate"]
}
Modified JSON:
{
"name": "API",
"version": 2,
"features": ["format", "validate", "diff"],
"status": "stable"
}
The result shows version as changed, deprecated as removed, status as added, and the new array item at /features/2 as added.
Semantic JSON diff vs text diff
A text diff treats spaces, indentation, line breaks, and property order as changes. A semantic JSON diff parses the structure first, so these documents are equal:
{"a":1,"b":2}
{
"b": 2,
"a": 1
}
JSON types still matter. The string "1" and the number 1 are different values.
How object keys and arrays are compared
JSON object keys are matched by name, so changing only their order does not create a difference.
Arrays remain ordered by default. The comparison aligns unchanged items before reporting additions or removals, so inserting one item does not mark every following item as changed. Enable Ignore array order when an array represents a collection such as tags or permissions. In that mode, duplicate counts still matter.
Reading the diff results
The summary separates Added, Removed, and Changed paths. Each result includes an RFC 6901 JSON Pointer, a readable JSONPath, the original and modified values, and their JSON types.
Use Previous and Next to move through the results. Locate selects the corresponding source range in the editors.
Large JSON files
Documents up to 5 MB are the normal target for this version. The tool displays a caution above 5 MB and limits each document to 20 MB because browser memory and speed vary. The measured comparison time appears with the result.
JSON diff FAQ
Does JSON key order matter?
No. JSON objects are compared by property name, so changing only the order of object keys produces no semantic difference.
Does array order matter?
Yes by default. Enable Ignore array order only when the array represents an unordered collection. Duplicate elements are still counted.
Why does "1" differ from 1?
They have different JSON types: one is a string and the other is a number. Semantic comparison does not coerce values between types.
Can I compare minified JSON?
Yes. Whitespace and indentation do not affect the comparison. Use the JSON Formatter when you only need to make one document easier to read.
What happens if one document is invalid?
The comparison stops and the affected editor shows syntax diagnostics. Use the JSON Validator for a focused syntax report or JSON Repair when you intentionally want to correct common non-standard input.
How large can each JSON document be?
Each document is limited to 20 MB. Performance below that limit still depends on the browser, device, and document structure.