Text Diff
Free online text diff — paste two versions of any text and see exactly what changed at the word level. Live updates as you type. Side-by-side or unified view. Runs entirely in your browser.
Identical
The two texts are exactly the same.
How Text Diff Works
This text diff uses a two-pass algorithm. First it splits both texts into lines and finds the longest common subsequence — the largest set of identical lines that appear in both versions. That gives the structural skeleton: which lines stayed, which were added, which were removed. Then for each pair of "changed" lines, it runs a second word-level pass, comparing word-by-word to highlight exactly which words inside the line are different. The result: when you change one word in a sentence, only that word is colored — not the whole line.
Side-by-Side vs Unified
Side-by-side shows the original on the left and the modified version on the right in two parallel columns. It's easier to read on desktop and matches how Diffchecker, GitHub, and Google Docs display revisions. Unified view interleaves both versions in a single column with + and − markers, like git diff in a terminal. Unified works better on narrow mobile screens and for sharing diffs in a single block of text. Toggle freely without losing scroll position or text.
Whitespace and Case Options
By default the diff is exact — every space and capital letter matters. Toggle "Ignore whitespace" to treat extra spaces, tabs, and trailing whitespace as identical, useful when comparing code that has been re-indented or re-formatted. Toggle "Case insensitive" to treat "Hello" and "hello" as the same, useful when checking that the meaning hasn't changed but capitalization has. Both options recompute the diff live without losing your text. For full text analysis with word counts and readability scores, try our Text Analyzer.
Frequently Asked Questions
- How does this text diff work?
- It runs a two-pass algorithm: first it splits both texts into lines and finds matching lines (the structure), then within each pair of changed lines it does a second word-level pass to highlight only the words that differ. This is the same approach Diffchecker, GitHub, and Google Docs use. Updates run live as you type — no Compare button needed.
- Why does my whole line show as changed when I only changed one word?
- It shouldn't. If a line differs by even a single word, this tool highlights only the changed word inside the line, not the whole line. If you're seeing whole lines colored when only one word changed, you're probably using the legacy version — refresh the page. The current version does word-level inline highlighting.
- What's the difference between side-by-side and unified view?
- Side-by-side shows the original on the left and modified on the right in two parallel columns. Best for desktop and longer texts where you can see both versions at once. Unified view interleaves both versions in a single column with + and − markers, like git diff. Better for narrow screens and short texts. The tool defaults to side-by-side on desktop and unified on mobile.
- Can I ignore whitespace or case when comparing?
- Yes. Toggle 'Ignore whitespace' to treat extra spaces, tabs, and trailing whitespace as identical — useful when comparing code that's been re-indented. Toggle 'Case insensitive' to treat 'Hello' and 'hello' as the same. Both options update the diff live without losing your text.
- How is the similarity percentage calculated?
- Similarity is the proportion of characters in the longer text that match the shorter one in sequence. 100% means the texts are identical. 0% means nothing matches. A 95% similarity usually means a single sentence was changed. Below 50% means major rewrites. It's a quick gauge of how different two versions are without reading the full diff.
- Is my text private?
- Yes. Everything runs in your browser using JavaScript — your text is never uploaded, logged, or transmitted anywhere. You can verify this by opening developer tools and checking the Network tab; no requests fire when you type. This makes the tool safe for confidential documents, code, contracts, or any sensitive content.
- How big a comparison can it handle?
- Performance is good up to about 5,000 lines per side on a typical laptop. The Myers-style two-pass diff is fast for documents under 100KB. For very large files (10,000+ lines, complete book manuscripts) you may notice a brief delay on first analysis — about a second. The tool runs entirely client-side, so the limit is your browser's memory.
- Can I share a comparison with someone?
- Use the Copy diff button to get a plain-text unified diff (the format git uses) that you can paste anywhere — email, chat, ticket, code review. The tool itself doesn't generate share links because that would require uploading your text to a server, and we don't do that.