Line comparison, not characters
Line diff splits both texts on newlines and reports added, removed and context lines, leaving the reader to inspect only the changed parts. Character diff can name the exact letters altered but produces fragmented output; line comparison reads better for config files, copy review and change records, since a line usually carries one meaning. Two panes — original on the left, revised on the right — feed a single comparison.
Steps
- Paste the original and the revised text, preserving line breaks.
- Compare to get removed, added and context lines.
- Load the sample or clear.
- Copy the merged output or download it.
- Use context lines for orientation and decide only on the changed ones.
Diff algorithms and their trade-offs
A naive line-by-line pass reports everything after an insertion as changed. Longest-common-subsequence matching labels just the inserted line. Refined approaches match lines first, then characterise unpaired lines at character level, giving both structure and detail. The algorithm shapes readability, which is why one edit can look enormous in one tool and trivial in another.
Whitespace and line endings
Trailing spaces, tabs mixed with spaces and CRLF versus LF all mark entire lines as different; mixed endings make a whole file look rewritten when nothing changed. Re-indenting from four spaces to two changes every line on paper. Serious comparison normalises endings and indentation first, or ignores whitespace deliberately — with the caveat that ignoring whitespace can hide genuine problems such as mis-indentation.
How to use merged output
Merged output joins both sides, usually keeping the revision and flagging conflicts. Reviewers read removals and additions, then check for omissions. For copy review the merge reads better than a list of hunks because order is preserved. For configuration, never accept a merge blindly: deleting a setting is more dangerous than adding one, and one lost line can stop a service. Verify in a test environment before applying.
Common problems:Comparing hundreds of lines against thousands collapses into block replacement, so compare in sections. Invisible characters copied from the web mark identical-looking text as different. Encoding mismatch makes every Chinese character disagree. Treating merged output as a patch — it is not a standard patch format and cannot be applied to a repository. Forgetting to paste the revised side. And comparing a single enormous minified line, where line diff cannot locate anything until you format first.
Where diff earns its time:It speeds up contract clause review, release-note checks, config comparison across environments and translation audits. It is not version control for large repositories, not a byte-level binary comparator, and never the sole audit evidence — critical changes still need human sign-off and a record.