Compare Text

Compare two texts side by side

About Compare Text

Compare Text puts two versions of a text side by side and marks what changed. Lines are matched with the Myers diff algorithm of the jsdiff library; inside a changed line, the words that differ are highlighted, red in the first text and green in the second. An inserted or deleted line is shown on its own row and the rest stays aligned. It suits drafts, contract clauses, and edited lists. It compares pasted text, not files, gives no line numbers, and runs in your browser.

Example

The ≠ sign stands for a red-tinted row and brackets for the words highlighted in red (left) and green (right); the page shows 2 difference(s) found.

Text 1 / Text 2

Text 1:
Dear Anna,
The meeting is on Monday.
Please bring the report.
Thanks,

Text 2:
Dear Anna,
The meeting is on Tuesday.
Please bring the report.
See you there.
Thanks,

Rows shown

  Dear Anna,                  | Dear Anna,
≠ The meeting is on [Monday]. | The meeting is on [Tuesday].
  Please bring the report.    | Please bring the report.
≠ empty                       | See you there.
  Thanks,                     | Thanks,

How to compare two texts

  1. 1Put the older wording in "Text 1" and the newer one in "Text 2".
  2. 2Check "Ignore case" when one version was retyped with other capitals, or "Ignore spaces" when only the spacing changed.
  3. 3Click "Compare"; the button works once both boxes hold text.
  4. 4Read the number of differences, then the rows: dark gray rows match, red-tinted rows differ, with changed words marked.

Formats and limits

Input
Two pasted texts; Windows, Mac, and Unix line breaks compare as equal
Ignore spaces
Ignores spaces at both ends of a line and the number of spaces between words; a b and ab still differ
Ignore case
Lines compared in lower case; each side is still shown as written
Result
Rows on screen only, with no copy, download, or line numbers

Where your text is processed

Both texts are compared in this tab by the jsdiff library, which the page fetches from this site the first time you click Compare. The texts themselves are never transmitted, and nothing is kept once you leave the page. This page offers no copy or download of the comparison, so it exists only on your screen.

Frequently asked questions

Does one inserted line make every following line different?

No. Only the inserted line is marked, opposite an empty cell, and the lines after it stay paired with their counterparts. Each changed or unmatched row adds one to the difference count shown above the rows.

Can it ignore extra spaces?

Yes, partly. "Ignore spaces" ignores spaces at the start and end of each line and treats several spaces as one, but a space present on one side only still counts: a b and ab differ. Inside changed lines, the word highlighting then skips spacing changes.

Can I compare two Word or PDF files?

No. Paste the text of each version instead. To check that two files of any type are byte-for-byte identical, use Compare Files; to compare code with line numbers, use Diff Viewer.

Tips and tricks

  • ✓Text pasted from a PDF often breaks lines differently in each version; join each version into one line with Remove Whitespace first, then compare the words.