Text Diff Tool
Free online text diff: compare two passages line by line, mark added, removed and unchanged lines, and report counts plus a similarity score.
How to Use
- Paste both passages
Put the original on the left and the revision on the right; results update as you type.
- Set comparison options
Tick ignore-whitespace or ignore-empty-lines as needed, or click 'Swap sides' to flip the direction.
- Read the diff stats
The panel reports added, removed and unchanged lines plus similarity; copy the diff when you are done.
FAQ
How is similarity calculated?
Similarity = 2 × unchanged lines ÷ (lines in A + lines in B), shown as a percentage. Identical inputs give 100%.
Why not just compare line by line in order?
The tool uses the longest common subsequence (LCS) algorithm, so insertions and deletions in the middle still align later identical lines correctly instead of cascading false changes.
Can I ignore whitespace and blank lines?
Yes. 'Ignore leading/trailing whitespace' trims each line first, and 'Ignore empty lines' skips blank lines before comparing — useful after formatting changes.
How much text can it handle?
A few thousand lines is fine. When the line-count product gets too large it falls back to a faster set-based comparison so the page stays responsive.