How to Compare Two Texts (Find the Differences)
A diff tool highlights exactly what changed between two versions of text or code. Learn how diffs work and when line-by-line comparison saves you.
To compare two texts, a diff tool lines them up and highlights every addition, deletion and change between them. Instead of re-reading both versions, you see only what is different.
How a diff works
A diff algorithm finds the longest sequence the two texts share, then marks everything else as added (in the new version) or removed (from the old one). Most tools show these line by line with color coding.
When it helps
- Reviewing edits to a document or contract
- Checking what changed between two versions of code
- Spotting an accidental change you cannot see by eye
- Comparing config files that should be identical
A tip on noise
Differences in spacing or letter case can create distracting "changes". Normalising case first — with the case converter — can make a real diff clearer.
Compare now
Paste both versions into the diff checker to see the differences highlighted instantly, all in your browser.