Comparison Methodology
ComparLab uses transparent, format-appropriate rules so you can understand why a value is marked as added, removed, or unchanged.
Text and source-code differences
Text, code, SQL, and Java comparisons can operate at line, word, or character precision. Line mode is useful for rewritten blocks and source files. Word mode exposes edits within prose, while character mode is suited to punctuation, identifiers, and short strings.
Optional cleanup can normalize line endings, collapse whitespace, ignore blank lines, or compare lowercase forms. These choices affect the comparison result but do not rewrite the original input fields.
List membership
The list tool treats each line as one item. It builds membership sets for List A and List B, then reports values only in A, only in B, and in both. Options control surrounding whitespace, empty lines, letter case, duplicate preservation, and output sorting.
JSON comparison
Both documents must parse as valid JSON. Object keys can be sorted recursively before comparison so property order and indentation do not create false changes. Array order remains significant because position can carry meaning in rankings, coordinates, and ordered API data.
XML comparison
XML is validated before comparison. Attribute order is normalized, and indentation-only whitespace can be removed. Element order, element names, attribute values, and text content remain meaningful. External resources are not fetched.
YAML comparison
YAML inputs are parsed using a safe core schema and formatted consistently before comparison. Custom executable tags are not run. Mapping order and sequence order remain visible in this version.
Limits and responsible review
Plain-text files are limited to 5 MB per side, and very large comparisons pause live recomputation to protect browser responsiveness. Semantic meaning depends on context, so security-sensitive, legal, financial, and production changes should always receive human review.
See the privacy policy for data-handling details or report a comparison problem.