JSON COMPARISON GUIDE
JSON diff vs text diff: when structure matters
Text diff compares characters and lines. JSON Diff first validates and parses both documents, then compares keys, values and arrays according to JSON structure.
- Use JSON Diff when formatting and object-key order should not create noise.
- Keep array order meaningful: moving an item remains a structural change.
- Use Text Compare only when the exact source formatting is part of the review.
The practical difference
| Question | Text diff | JSON Diff |
|---|---|---|
| Does object-key order matter? | Yes, because the lines or characters moved. | No. Objects are compared by key and value. |
| Does array order matter? | Yes. | Yes. Array position is preserved. |
| Must both inputs be valid JSON? | No. | Yes. Validation happens before comparison. |
| Can it identify a nested path? | Only by visible source position. | Yes, with a JSON Pointer path. |
Object-key order should not create a false change
Original: {"id": 7, "status": "draft"}
Changed: {"status": "draft", "id": 7}A text diff can highlight the entire line because the source order changed. JSON Diff reports no structural difference because both objects contain the same keys and values.
Array order remains meaningful
Original: {"steps": ["build", "test", "deploy"]}
Changed: {"steps": ["test", "build", "deploy"]}Diff Master reports the reordered array items as changes. The tool does not assume that arrays are unordered sets because position can affect meaning and execution order.
Validation protects the structural result
JSON Diff accepts strict JSON. Comments, trailing commas, duplicate object keys, unsupported numeric values and excessive nesting stop the comparison with the affected side, line and column. The tool does not silently fall back to a text comparison.
When text diff is still the right choice
Use Text Compare when indentation, spacing or exact source ordering is the change you need to review. Use Code Compare when you also need syntax highlighting or Unified Diff.
Current limits
Diff Master preserves array order and does not currently support custom path exclusions, unordered-array matching or numeric tolerances. Parsing and comparison run locally in this browser tab.
Ready to compare?
Open the matching tool and keep both versions in this browser.
Compare JSON by structure