Line, word and character diffs, and when to use each
How line, word and character comparison differ, why an edit can show as a remove plus an add, and which mode fits prose versus code.
Three levels of granularity
A diff can compare text at different resolutions. Line mode looks only at whole lines and is the fastest, ideal for code and structured files where each line is a meaningful unit. Word mode breaks the text into words and highlights the exact ones that changed, which suits edited prose. Character mode goes finer still, marking individual characters, and is handy for catching a single typo or a changed digit. This tool lets you switch between all three so you can zoom in as far as the change demands.
Why a small edit can look like two changes
Line based diffs match whole lines exactly. When you change even one word in a line, that line no longer matches its original, so the algorithm records the old line as removed and the new line as added. In the unified view this appears as a minus line followed by a plus line. Side by side line mode softens this by aligning the pair as a single modified row and highlighting only the part that differs, and word or character mode narrows the highlight further to the exact tokens involved.
How the longest common subsequence keeps context
The engine finds the longest common subsequence, the longest ordered set of matching pieces shared by both texts. Everything on that path is treated as unchanged, which anchors the diff to the parts you did not touch and prevents small edits from cascading into a wall of differences. Because it respects order, a paragraph you moved elsewhere shows as a deletion in its old spot and an insertion in its new one rather than a confusing tangle, keeping the surrounding unchanged lines stable and readable.
Ignoring noise to focus on real changes
Not every difference is meaningful. Reindented code, trailing spaces or a change from lower to upper case can bury the edits you care about. Ignore whitespace collapses spacing differences so only substantive line changes remain, and Ignore case does the same for letter case. Combined with Collapse unchanged, which hides long stretches of matching lines and shows just a count, these options turn a noisy comparison into a short list of the edits that actually matter.