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)
Frequently Asked Questions
What's the difference between word-level and character-level diff?
Word-level diff shows which entire words were added or removed, making it better for comparing prose like documents and contracts where you care about meaning. Character-level diff highlights individual character changes, which is more useful for catching subtle edits like typo fixes or single-character code changes. Choose word-level for readability and character-level when precision matters.
Can I use this tool to compare code without Git?
Yes. If you don't have version control set up or need to compare code between two different files that aren't in a Git repository, you can paste both versions into the text diff tool and it will highlight exactly what changed. This is especially useful for code reviews when Git diff isn't available.
How does the diff algorithm decide what counts as a change?
Modern diff algorithms like Myers' algorithm (used by Git) find the Longest Common Subsequence (LCS) — the longest sequence of text that appears in both versions in the same order. Everything in the old version outside the LCS is marked as deleted, and everything in the new version outside the LCS is marked as added. This approach minimizes the number of changes shown, making the results more meaningful.
Why should I use a diff tool instead of just re-reading both versions?
A diff tool saves you time by instantly highlighting only what changed, rather than forcing you to manually spot differences across the entire document. For something like a 20-page terms of service update or a multi-paragraph contract revision, this can take seconds instead of minutes or hours. It's also more reliable—you won't accidentally miss a buried change.
This article is for informational purposes only. See our disclaimer.