Skip to content
Test versionSearch

Text and writing

Text comparison

Compare two texts by line or by word. Line mode shows original and revised line numbers; word mode marks inserted and removed words.

How it worksFAQRelated tools

Content reviewed:

Also available for Germany, in German 

Text stays in this tab; it is not uploaded or saved by this tool. Maximum 20,000 UTF-16 code units per input. Line mode accepts up to 300 lines per text; word mode accepts up to 600 word or whitespace groups. Oversized input is rejected, not truncated. CRLF and CR line endings are treated as LF. Copying may place results in your device's clipboard; downloading saves a text file.

Line mode allows 300 lines per text, including a final empty line. Word mode allows 600 word or whitespace groups per text. Both use a longest common subsequence and remove the original first on ties. Word-mode counts exclude whitespace; unchanged whitespace remains in the displayed result. Markers [-removed-] and {+added+} are literal text, so the display can be ambiguous if the input contains those markers. Neither mode detects moved text. Case, spaces, tabs and Unicode composition remain significant. CRLF and CR become LF; a change in line-ending style alone is ignored. Submitted markup is displayed as plain text, never executed.

How it works

Matching whole lines remain unchanged; unmatched lines are shown as removals or additions. Spacing and case are significant.

Worked example

Changing the single line cat to dog produces one removed line and one added line.

About this calculation

The tool compares an original and a revised text, either line by line or word by word. It looks for the longest common sequence of lines or words that both texts share. Anything in that sequence is shown as unchanged, and the rest appears as removed from the original or added in the revision. Line mode shows original and revised line numbers, while word mode marks changes with [-removed-] and {+added+}.

Case, spaces, tabs and Unicode composition all count as differences. Only line endings are evened out, so a switch between CRLF, CR and LF on its own is ignored. Moved text is not detected: a moved block appears as one removal and one addition. If your text already contains the markers, the display can be confusing. Each text may hold up to 20,000 UTF-16 code units, 300 lines or 600 word groups; longer input is rejected, not cut.

Example: comparing First line, Old text, Last line with First line, New text, Last line gives two unchanged lines, one removed line and one added line.

Worked example

With these example values the calculator gives the result below. You can change any value in the form above.

Inputs

Original text
First line Old text Last line
Revised text
First line New text Last line
Comparison mode
By lines

Result

Texts differ
≠
Unchanged
2
Removed
1
Added
1
Marked differences
Copy differencesSelect differencesDownload text file
Unchanged · Original line 1 / Revised line 1
First line
Removed · Original line 2 / Revised line:
Old text
Added · Original line: / Revised line 2
New text
Unchanged · Original line 3 / Revised line 3
Last line

Frequently asked questions

How do I compare two texts for differences?

Paste the original and the revised text and choose line or word mode. Line mode shows original and revised line numbers, and word mode marks inserted and removed words.

How long can the texts be in the text comparison?

Each input may have up to 20,000 UTF-16 code units. Line mode accepts up to 300 lines per text and word mode up to 600 word or whitespace groups; oversized input is rejected, not truncated.

Does the text comparison ignore case and spaces?

No. Case, spaces, tabs and Unicode composition remain significant. Only a change in line-ending style alone is ignored, because CRLF and CR are treated as LF.

How does the text comparison find changes?

Both modes use a longest common subsequence and show the original first on ties. Matching whole lines stay unchanged, while unmatched lines appear as removals or additions.

Does the text comparison detect moved paragraphs?

No. Neither line mode nor word mode detects moved text; a moved block appears as a removal and an addition.

What do the markers [-removed-] and {+added+} mean?

In word mode they mark removed and added words as literal text. If your input already contains those markers, the display can be ambiguous.

What happens when one line changes from cat to dog?

Changing the single line cat to dog produces one removed line and one added line in line mode.