Text Diff Tool: Finding What Changed Between Two Versions
Text diff tools show you exactly what changed between two versions of text. You paste in the old version and new version; the tool highlights additions (typically green) and deletions (typically red) at the word or character level.
When This Is Useful
Document revisions: You sent a contract draft last week and received a "revised" version. Instead of re-reading the whole document, diff the two versions and see exactly what changed.
Code review without a git diff: Comparing two versions of code when you don't have version control, or comparing code between two different files.
Terms of service changes: A service updated their ToS. Diff the old and new versions to see what actually changed without reading 20 pages.
Writing revisions: Compare your first and final draft to see how much actually changed.
Data comparison: Two CSV exports or JSON files that should be identical but aren't — diff them to find the discrepancy.
How Diff Algorithms Work
The classic diff algorithm (used by Unix diff, Git, and most comparison tools) finds the Longest Common Subsequence (LCS) between the two texts — the longest sequence of text elements that appears in both in the same order, possibly with gaps.
Everything in the old text but not in the LCS is a deletion. Everything in the new text but not in the LCS is an addition.
Myers' diff algorithm (used by Git) is the modern standard — it's optimized to minimize the number of edit operations (insertions and deletions) needed to transform one text into another, which tends to produce more readable and meaningful diffs.
Word-Level vs. Character-Level
Word-level diff: shows which words were added or removed. Better for prose.
Character-level diff: shows which individual characters changed. Better for catching subtle changes like typo corrections or single-character substitutions.
[Compare two texts →](https://doesitaddup.com)
This article is for informational purposes only. See our disclaimer.