Text Tools · · 5 min read
How to Compare Two Texts Online (Word or Line Diff)
Paste two versions of a text into the Text Diff tool to see exactly what changed, word by word or line by line, with an added/removed count.
To compare two texts online, paste the original into one box and the edited version into the other in the Text Diff tool — it highlights every addition and removal instantly, either word by word or line by line, with a running +added / −removed count.
What Text Diff does
It takes two blocks of text — labeled Original and Changed — and shows you exactly what's different between them, without you having to read both side by side and spot the changes yourself. That's useful for reviewing edits to a contract clause, checking what a client changed in a paragraph of copy, comparing two versions of a config file, or seeing what actually moved between two drafts of the same code snippet.
How to compare text with Toolbench
- Open Text Diff.
- Pick a mode: Words (compares individual words) or Lines (compares whole lines). Words is selected by default.
- Paste the older version into the Original box.
- Paste the newer version into the Changed box.
- The Differences panel updates immediately, with removed text struck through in red and added text highlighted in green. The
+N / −Ncount in the top-right tallies how many words (or lines) were added and removed. - Got the two texts backwards? Click ⇄ Swap to flip Original and Changed without retyping anything.
- Click Copy to copy the differences, or use Send to → to send them into another tool.
Example: reviewing an edited paragraph
Text Diff's own default demo compares:
Original:
The quick brown fox jumps over the lazy dog.
Ship on Friday.
Team: 4 people
Changed:
The quick red fox leaps over the lazy dog.
Ship on Monday.
Team: 4 people
Budget approved
In Words mode, this comes out as +5 / −3, with the differences panel showing:
The quick [-brown-]{+red+} fox [-jumps-]{+leaps+} over the lazy dog.
Ship on [-Friday.-]{+Monday.+}
Team: 4 people{+
+}{+Budget+}{+ +}{+approved+}
(In the browser, [-brown-] renders as struck-through red text and {+red+} as highlighted green text — the bracket notation above is just how it looks if you copy the result as plain text.) Three words were swapped (brown→red, jumps→leaps, Friday.→Monday.) and a whole new line, "Budget approved," was added at the end.
Switch the same two texts to Lines mode and the count changes to +3 / −2, because now whole lines are compared instead of individual words:
− The quick brown fox jumps over the lazy dog.
− Ship on Friday.
+ The quick red fox leaps over the lazy dog.
+ Ship on Monday.
Team: 4 people
+ Budget approved
Any line with even one word changed counts as fully removed and fully added in Lines mode — that's the trade-off for the coarser, easier-to-scan view.
Words mode vs. Lines mode
| Words mode | Lines mode | |
|---|---|---|
| Compares | Individual words (and the whitespace between them) | Whole lines |
| Best for | Prose, single paragraphs, sentences with small wording changes | Config files, code, lists, anything organized line by line |
| A one-word change in a long line shows as | Just that word highlighted | The entire line marked removed, then re-added |
| Output format when copied | Changed words wrapped in [-removed-] and {+added+} |
Each line prefixed with − , + , or two spaces |
Tips and common mistakes
- A single changed word in Lines mode marks the whole line as changed, not just the word. If you're comparing prose and want to see exactly which words moved, use Words mode instead.
- The added/removed counter only tallies actual words or lines, not whitespace. A stray added blank line or space isn't counted, even though it does show up as a highlighted token in the Differences panel.
- Very long inputs in Words mode can get too large for the browser to diff. If you see "Too large to diff in the browser," switch to Lines mode (it compares far fewer tokens) or shorten the text.
- Use ⇄ Swap instead of copy-pasting the two boxes into each other. It's the same comparison in reverse — what was added now shows as removed, and vice versa.
- Clean messy text first if the diff looks noisy. Curly quotes, extra spaces or stray HTML in only one of the two versions will show up as differences even when the visible words are the same — run both through Text Cleaner first if that's not what you want to compare.
Related tools
- Text Cleaner — strip HTML, smart quotes and extra whitespace before diffing, so formatting noise doesn't show up as a fake change.
- Find and Replace — once you know what changed, apply the same replacement across a larger block of text.
- Sort & Dedupe Lines — sort or deduplicate a list before comparing two versions of it line by line.
- Word Counter — check the word and character count of either version before or after comparing.
Frequently asked questions
Is my text sent to a server when I compare it?
No. The comparison runs in your browser as you type. If you're signed in, both text boxes sync privately to your account so they're there next time; if you're signed out, nothing is saved anywhere.
What's the difference between Words mode and Lines mode?
Words mode compares individual words, so it can show that just one word in a sentence changed. Lines mode compares whole lines, so it's better for structured content like code or config files where you want to see which entire lines were added or removed.
Why does one small edit mark an entire line as changed?
That only happens in Lines mode, which treats each line as a single unit — if any part of it differs, the whole line is shown as removed from the original and added in the changed version. Switch to Words mode to see just the specific word that changed.
Can Text Diff compare two files directly?
No, it compares whatever text you paste into the Original and Changed boxes — there's no file upload. Open both files, copy their contents, and paste each into the matching box.
Does the added/removed count include whitespace changes?
No. The +N / −N counter only counts actual words or lines with visible content — whitespace-only differences (like an extra blank line) still appear highlighted in the Differences panel but aren't added to the count.
More guides
- How to Test a Regex Online (With Live Matches and Groups)Test JavaScript regular expressions live — highlighted matches, capture groups per match and a real-time replace preview, no install needed.
- How to Convert Text Case Online (UPPERCASE, camelCase, More)Convert text into UPPERCASE, Title Case, camelCase, snake_case, kebab-case, CONSTANT_CASE and more at once, with real, verified examples of each.
- How to Count Words and Characters Online (and Hit Every Length Limit)How word, character, sentence and reading-time counts work, the length limits that matter, and a free counter that updates as you type.