How to compare two texts, line by line
- Paste the version you started with into the first box.
- Paste the version you want to check against it into the second.
- Press Compare the two. Rows that differ are marked; rows that match are left plain.
- Save the file if you want the differences as a patch to send on.
Why two texts that look identical still differ
Most of the time the difference has no shape on screen. A trailing space at the end of a line, a tab where the other copy has four spaces, one file saved with Windows line endings and the other with Unix ones. All invisible, and any of them enough to make a comparison call every single line changed.
Line endings are ignored here to start with, so a Windows copy and a Unix copy of the same words come back identical rather than entirely different. Ignoring case and collapsing runs of whitespace are two more switches, and both begin off, because the first thing you usually want to know is whether the two are literally the same.
What a marked row is telling you
Every row is a whole line. When a line has been edited you see the old one and the new one beside each other, but the changed word inside it is not highlighted — that refinement is not built yet, and saying so beats letting you assume a one-character edit will be pointed out for you.
The counts above the table are lines added, lines removed and lines changed. A pair of rows counted as changed is one line replaced by another; a row with nothing opposite it is a line that exists on only one side.
When the two are barely related
Comparing two texts that share almost nothing is the expensive case, and done naively it can lock a mid-range phone up for ten or fifteen seconds. This page stops instead. If the work runs past its budget the changed region comes back as one block replacement with a note saying that is what happened — a rough answer quickly, rather than a page that appears to have died.
The other case worth knowing is a paste with no line breaks in it at all. A comparison of lines has nothing to grip, so the whole paragraph is treated as one very long line and marked as changed. Break it at the full stops first and the comparison becomes useful again; the page says so when it notices.