search

Found

info Overview

Compare two texts word by word and highlight added, removed, and unchanged words in color, with a similarity percentage shown alongside the diff.

📘 How to Use

  1. Paste the source version into Text A and the edited version into Text B
  2. Read the highlighted diff, where added words show green and removed words show struck-through red
  3. Check the added, removed, unchanged, and similarity counters above the result

Word-Level Text Diff

Added 0
Removed 0
Unchanged 0
Similarity: --%
Enter both texts to see the diff...
Copied!

※ Word-level additions and deletions are detected with the longest common subsequence (LCS) algorithm.

Article

Word-Level Text Diff | Compare Two Texts Word by Word

Drop a before and after version side by side and see every word that was added or removed, highlighted inline. A word-count similarity percentage tells you at a glance how far the two versions drifted apart.

💡 The granularity between character and line diffs

Most diff tools pick one of two extremes. A character-level diff lights up on every keystroke, so a single typo fix scatters dozens of tiny marks across a paragraph. A line-level diff, the kind you see in code review, treats a whole line as changed even if only one word moved. Prose lives in between: when you reword a sentence, what actually changed is the words, not the characters and not the entire line.

This tool tokenizes both texts on whitespace and runs a longest common subsequence (LCS) pass over the word sequences. The result reads like tracked changes: shared words stay neutral, new words glow green, and deleted words appear struck through in red. Because the comparison is anchored on words, moving one term or swapping a synonym produces a clean, readable edit map instead of a wall of single-character noise. The added, removed, and unchanged tallies plus the similarity score give you a quick numeric read on how heavy the revision was.

🧐 Frequently Asked Questions

How is word-level diff different from a character diff? A character diff compares letter by letter, so correcting one typo can mark several adjacent characters. A word diff treats each whitespace-separated word as the unit, so the same fix is reported as one removed word and one added word. For editing prose, the word view is far easier to scan.

How is the similarity percentage calculated? It is the number of unchanged words divided by the larger of the two word counts, shown as a percentage. Two identical texts read 100%, and two texts with no shared words read 0%.

Does it work with languages that do not use spaces? The algorithm splits on whitespace, so it is built for space-separated languages. Text without spaces, such as Chinese or Japanese, collapses into very few word tokens, and a character-level or n-gram tool will give a more meaningful result there.

Is there a length limit? There is no hard cap, but the exact LCS comparison is quadratic in the word count. For very large inputs the tool automatically switches to a faster greedy walk, which trades a little accuracy for speed so the page stays responsive.

What does the copied output look like? Added words are wrapped in [+ ] and removed words in [- ], with unchanged words left plain, so you can paste a readable plain-text change log anywhere.

📚 Fun Facts

The longest common subsequence problem behind this tool is the same idea that powers the classic diff utility born at Bell Labs in the 1970s, and it is a textbook example of dynamic programming. Bioinformatics borrows the very same logic to align DNA and protein sequences, where the alphabet is nucleotides instead of words. Whether you are comparing two drafts of an essay or two strands of a genome, the question is identical: what is the longest run of elements both versions share, and what had to be inserted or deleted to get from one to the other?