Worked example
A shopping list changed from “Milk, Eggs, Bread (white), Apples” to “Milk, Bread (wholemeal), Apples, Coffee”, one item per line. The comparison finds 2 lines the same, 1 changed, 1 added and 1 removed: “Eggs” paired with the new bread line shows as a change, “Bread (white)” as removed, and “Coffee” as added. The plain-text report you can copy reads:
Milk - Eggs + Bread (wholemeal) - Bread (white) Apples + Coffee
Lines starting with − were in the original, lines with + are in the new version, and indented lines are unchanged.
Reading the results
- Changed: a line removed and a line added at the same place. The words that differ are highlighted, so a single edited word in a long paragraph stands out.
- Added or removed: lines with no partner on the other side.
- Moved text appears as removed in one place and added in another, as in every line-based comparison.
Tips for cleaner comparisons
Paragraphs are compared as single lines, so one change marks a whole paragraph; the word highlights then show exactly what moved. If you are comparing text from two PDFs or web pages where line breaks fall in different places, join each paragraph onto one line first, or tick “Ignore extra spaces”. For code, keep the original indentation and leave the option off, because spaces can matter.
Who uses a diff checker
Writers check what an editor changed in a draft; students compare a rewrite with the first version; lawyers and landlords spot edits in a contract before signing; developers compare configuration files and code snippets; translators check that a new version of a source text only changed where expected. In each case, seeing the exact words that changed is faster and safer than reading both versions side by side yourself.
How the comparison is calculated
The tool treats each text as a list of lines and looks for the longest run of lines the two have in common, in order. Everything outside that common run is either a removal or an addition. Myers’ algorithm finds this with the fewest possible edits, working along diagonals of an edit graph and stopping as soon as the two texts meet. Lines that sit opposite each other are then split into words and spaces and compared the same way, which is how a single changed word in a long line is highlighted. Because the method always finds the smallest set of changes, two runs on the same texts give the same answer every time.
Related tools
Sources
Checked on November 26, 2026:
- Myers EW. An O(ND) difference algorithm and its variations. Algorithmica 1986;1:251-266
- GNU diffutils manual: unified format
Frequently asked questions
How does the text compare tool work?
What do the colours mean?
Can it ignore capital letters and spaces?
Can I compare Word documents or PDFs?
Is there a size limit?
Is my text uploaded?
Last updated: 2026-11-26