Last updated 3 September 2026
How a line diff decides what changed
The comparison works by finding the longest sequence of lines that appears in both versions in the same order — the longest common subsequence. Everything in that sequence is unchanged; everything else is either a removal from the original or an addition in the new version. This is the same approach version control uses, and it explains a behaviour that sometimes surprises people: editing one word in a line produces a removed line and an added line rather than a marked-up single line, because the unit of comparison is the whole line. The two options above deal with the usual sources of false positives — trailing whitespace that no one can see, and capitalisation differences that may not matter for your purposes.
How a diff is calculated
A diff does not compare the two texts position by position. It searches for the longest sequence of lines common to both and treats everything outside that as an insertion or a deletion. This is why adding one line near the top does not mark every subsequent line as changed — the algorithm recognises that the rest still matches, just at a different offset.
Line-level comparison is the default because it matches how people edit. Character-level comparison is more precise but produces noisy output on prose, where a reworded sentence becomes a scatter of tiny changes rather than one clear replacement. Word-level sits between the two and is usually the most readable choice for text that is not code.
The differences you cannot see
Whitespace is the most common cause of a diff that reports changes where the text looks identical. Trailing spaces, a tab converted to spaces, or a file that mixes Windows line endings with Unix ones will all register as differences while appearing the same on screen. If a diff shows every line as changed and nothing looks different, mismatched line endings are almost always the cause.
Encoding produces a similar effect. A smart quote pasted from a word processor is a different character from a straight apostrophe, and a non-breaking space is not a normal space. These are invisible and are frequently what breaks a configuration file or a script after someone has edited it in the wrong application. A diff is often the fastest way to locate them, precisely because it does not rely on how the characters look.
Common questions
Why does a small edit show as both a removal and an addition?
Because the comparison works on whole lines. If any part of a line differs, the old line is gone and a new one has taken its place. Most version-control tools report line diffs the same way.
Is my text uploaded anywhere?
No. Both texts stay in your browser and the comparison runs locally. Nothing is transmitted, which makes it safe for drafts, contracts or code you would not want to paste into a server-side tool.
What do the options do?
Ignoring leading and trailing spaces stops invisible whitespace from registering as a change. Ignoring case treats capitalisation differences as identical, which is useful when comparing prose but usually not what you want for code.
How large a text can it handle?
Comfortably up to a few thousand lines. The matching work grows with the size of both texts, so very large files will feel slow — for those, a desktop diff tool is the better instrument.
Why does the diff show changes when the text looks identical?
Almost always invisible characters. Trailing spaces, tabs converted to spaces, or mixed Windows and Unix line endings all count as real differences while appearing the same on screen. If every line is marked changed, mismatched line endings are the usual cause.
Should I compare by line, word or character?
Line comparison suits code and structured files, since it matches how they are edited. Word comparison is usually the most readable for prose. Character comparison is the most precise but produces noisy output where a reworded sentence becomes many tiny changes.
Is my text uploaded when I compare it?
No. The comparison runs entirely in your browser using JavaScript, so nothing is transmitted or stored. That makes it usable on contracts, configuration files and other content you would not paste into a hosted service.