Advertisement

Text Compare — Find the Differences Between Two Texts

Compare two texts line by line, word by word or character by character. See added and removed parts, a marked comparison and a similarity percentage.

Compare by
Trims lines and treats runs of spaces as one

Paste two versions of a text to compare their contents. Compare lines for documents, code and lists, words for edited paragraphs, or Unicode code points for short strings such as names and IDs. The tool marks additions and removals, shows both versions together and gives a similarity percentage. Comparison runs locally in your browser.

How to use this tool

  1. Paste the original text into the first box and the changed text into the second.
  2. Choose to compare by lines, words or characters.
  3. Tick Ignore capital letters or Ignore extra spaces if those differences don't matter.
  4. Read the summary, then the Differences box and the table of changes.

Formula

Similarity (%) = 2 × unchanged units ÷ (units in original + units in changed text) × 100

Myers diff aligns tokens in order. Word-mode totals count letter/digit tokens, while punctuation and spacing can still differ at 100% word similarity; use Identical to check all compared tokens. Internal apostrophes/hyphens stay in words. Character mode counts code points, so a joined emoji can span several units. Line endings normalize to LF; a final newline remains significant.

Example

Compare “the quick brown fox” with “the quick red fox” in Words mode. Three words match; one is removed and one added. Similarity = 2 × 3 ÷ (4 + 4) × 100 = 75%, and the marked result is “the quick [-brown-] {+red+} fox”. Comparing “Hello.” with “Hello!” gives 100% word similarity but Identical: No, because the punctuation changed.

Frequently asked questions

Which mode should I use?

Lines for code, lists, CSV data and anything where each line matters. Words for prose that was edited and re-flowed. Characters for short strings where a single letter matters, such as "recieve" vs "receive".

Why is a changed line shown as removed and added?

In line mode a line either matches or it doesn't, so an edited line appears as the old version removed and the new version added. Switch to Words mode to see which words inside it changed.

Is there a size limit?

Both texts together may contain at most 500,000 UTF-16 units and 50,000 comparison tokens; character mode also caps at 20,000 code points. A five-second diff timeout may reject very different texts. Split large documents into sections.

What does Ignore extra spaces do?

Word mode ignores all whitespace when selected, including line breaks. Lines mode trims each line and collapses horizontal whitespace. Character mode collapses horizontal whitespace and trims the whole text. Untick it to compare spacing exactly after line-ending normalization.

Is my text uploaded?

No. The comparison runs entirely in your browser.

Sources

Last updated: 2026-10-30

Advertisement