How to use the text diff tool
- Paste the original text on the left and the modified version on the right.
- Choose how much surrounding context you want to see around each change.
- Click Compare (results also update automatically as you type). Removed lines appear in red, added lines in green.
Features
- Accurate matching — uses a longest-common-subsequence algorithm, so unchanged lines stay in place instead of being flagged as remove-then-add.
- Change statistics — instant counts of added, removed and unchanged lines.
- Context control — show only the changed lines or fold in a few neighbours for orientation.
- Whitespace-tolerant mode — ignore pure whitespace changes when reviewing code or prose.
- 100% private — comparing happens in your browser. Paste configs, drafts or proprietary text freely.
How a diff works
A diff finds the smallest sensible set of edits that turns the original text into the modified one. First the two texts are split into lines; the algorithm then aligns identical lines (the common subsequence) and reports the rest as removals and additions. Tools like git diff work on the same principle — this page gives you the same insight without needing a repository.
Frequently asked questions
Is my text uploaded anywhere?
No. Both texts are compared locally in your browser using JavaScript. Nothing you paste is transmitted — you can even use it offline.
Why does a whole block show as removed and re-added instead of one changed line?
That happens when the middle lines changed enough that the algorithm can no longer align them with the original. Toggling ignore whitespace helps when the only difference is indentation. For genuinely rewritten blocks, a large red/green chunk is the honest answer.
Can I use it for large files?
Yes, with sensible limits. The page processes up to a few thousand lines; extremely large inputs switch to a fast prefix/suffix comparison so the page stays responsive. For very big repository diffs you're better served by git diff or a dedicated diff app.
Does it compare whole lines or individual words?
This version compares line by line, which is the clearest view for code and structured text. For paragraph edits in prose, line-level diff plus a couple of context lines is usually enough to spot the change.