Skip to content
Text

Text Compare

Compare two texts word-by-word with a color-coded inline diff.

textcomparediffwordschanges
Loading tool…

About the Text Compare

Finding exactly what changed between two versions of a text is notoriously hard: by the second or third paragraph, your eyes start skipping the identical parts and missing the real edits. The Text Compare tool solves this with a precise, word-by-word diff. Paste the original into Text A and the revised version into Text B, and the tool computes a color-coded inline comparison where removed words appear struck through in red and added words stand out in green, with unchanged text left neutral. It is not a line-by-line diff but a true word-level diff, so a single swapped adjective inside a sentence is caught immediately, and newline changes are preserved as visible breaks. Two toggles refine the comparison — Ignore case and Ignore whitespace — and a stat row reports words in each text plus common, added, and removed token counts. When both sides match, a green banner confirms the texts are identical, noting any case or whitespace allowances. Editors, developers reviewing copy changes, and legal teams tracking contract revisions all get certainty instead of squinting.

Text Compare examples

Input
Text A:
The quick brown fox
jumps over the lazy dog.
A classic pangram.

Text B:
The quick red fox
jumps over the sleepy dog.
A famous pangram indeed.
Output
Word-level diff:
brown (red, struck through) → red (green)
lazy (red) → sleepy (green)
classic (red) → famous (green)
+ indeed (green)

Stats:
Words in A: 12 · Words in B: 13
Added: 4 · Removed: 3 · Common: 11
Note: The default sample pair: swapped adjectives and one added word are caught immediately.
Input
Text A: Hello world
Text B: hello WORLD
Output
Status: Texts are identical (case-insensitive match)

Words in A: 2 · Words in B: 2
Common: 2 · Added: 0 · Removed: 0
Note: With Ignore case on, the casing differences disappear from the diff.
Input
Text A: first line
second line
Text B: first line second line
Output
Status: Texts are identical (whitespace ignored)

Words in A: 4 · Words in B: 4
Common: 4 · Added: 0 · Removed: 0
Note: With Ignore whitespace on, the collapsed newline change no longer counts as a difference.

How to use the Text Compare

  1. 1

    Paste the original version into Text A and the revised version into Text B.

  2. 2

    Review the Word-level diff: green highlights are added words, red struck-through words were removed, and common words stay neutral.

  3. 3

    Toggle Ignore case or Ignore whitespace to filter out those difference types.

  4. 4

    Check the stat row — Words in A, Words in B, Common, Added, Removed — for a numeric summary.

  5. 5

    Click Clear to reset both panes; a green banner confirms when the texts are identical.

Common use cases

  • Reviewing edited article drafts against the original version.
  • Verifying contract or policy revisions word by word.
  • Checking code review copy changes between commits.
  • Confirming API documentation updates match the release notes.
  • Spotting accidental edits in pasted translations.
  • Validating that a CMS import preserved copy exactly.

Best practices

  • Compare clean copies: normalize encodings first so the diff is not polluted by invisible character changes.
  • Leave Ignore case off for code and identifiers where casing is meaningful.
  • Use Ignore whitespace when reviewing copy that passed through different editors or line wrapping.
  • Read the diff in both directions — green words in B are additions, red words in A are deletions.
  • Tighten the comparison to short sections when a large document produces a noisy diff.

Tips

  • Turn on Ignore whitespace when comparing copy that passed through different editors or line-wrapping.
  • Keep Ignore case off for code comparisons — a casing change often signals a real rename.
  • The diff is word-level, so paste whole paragraphs instead of single lines to catch mid-sentence edits.
  • Check the Common stat first: a high common count means only small targeted edits, a low one means a rewrite.

Frequently asked questions

The tool tokenizes both texts into words, preserving newline characters as explicit tokens, then computes the longest common subsequence between the two token lists. Tokens in the shared sequence are marked common, tokens in Text A but not the shared path are removed, and tokens only in Text B are added. The result is a minimal, human-friendly edit script.

Added words appear highlighted in green, removed words appear in red with a strikethrough, and unchanged words stay neutral gray. A legend above the Word-level diff lists all three markers, so you can interpret the result at a glance even on a first visit, and the same coloring logic applies whether you are comparing paragraphs or code snippets.

It collapses all whitespace — spaces, tabs, and newlines — into single spaces before comparing, so two versions that differ only in line breaks or extra spacing are treated as identical. The banner then confirms the texts are identical with whitespace ignored. Leave it off when line-break changes matter, since newlines are otherwise shown as diff tokens.

Yes. The comparison is word-based rather than line-based, so it highlights changed tokens inside lines rather than replacing whole lines, which suits code, URLs, and logs well. Note that punctuation attached to words travels with its token, so trailing commas or semicolons count as part of a word when the tool decides what changed.

Words in A and Words in B exclude newline tokens, but the Common, Added, and Removed stats count every token in the diff, including newlines. When the texts contain line breaks, Common plus Added plus Removed can therefore exceed the word counts. The word counts are the human-facing figures; the token stats reflect the full internal diff.

A green status banner appears reading "Texts are identical", appending "case-insensitive match" or "whitespace ignored" when those toggles are active. Added and Removed both read zero, and every token is marked common. The banner only appears when both text areas are non-empty, so two empty boxes are not reported as a match.

Explore more text tools

Browse the full collection of text tools on the hub, or jump back to all categories.

Related tools

Did this tool help?

Anonymous — one tap, no sign-up.