Modern Niche World MNW

Text Compare

Paste an original and a changed version to see every line that differs, side by side, with the changed words marked inside each changed line.

No lines yet

No lines yet

Up to 20,000 lines and 5 million characters a side. Both texts stay on this page: nothing is sent anywhere or saved.

Paste or type a text in each box to compare them.

See exactly what changed between two versions

Two drafts of a letter, an old and a new config file, the terms you agreed to last year and this year’s: reading them side by side, it’s easy to miss the one word that changed. Paste both versions and this tool lines them up, shows every line that differs and marks the changed words inside each changed line.

How to use it

  1. Paste the earlier version in Original and the later one in Changed. Press Try an example to see how it works first.
  2. Read the counts: lines changed, added and removed.
  3. Read the comparison. Lines marked − are only in the original, lines marked + only in the changed text.
  4. Copy the result as a .diff, or download it as a file.

Reading the comparison

On a wide screen the two versions sit side by side; on a phone they share one column, with each removed line just above the line that replaced it. A removed line and an added line in the same place count as one changed line when at least half their words are the same; the words that differ are then marked. Long runs of unchanged lines fold away to a count, keeping three lines around each change.

What the options do

  • Ignore case: “Apple” and “apple” count as the same.
  • Ignore spaces at line ends: spaces or tabs left at the end of a line don’t count as a change.
  • Show unchanged lines: shows every line instead of folding the unchanged ones.

The .diff file

The download is a unified diff, the format of diff -u, which programmers use to share and apply changes. The options apply to it too, as diff’s -i and -Z options would.

Good to know

  • Limits: up to 20,000 lines and 5 million characters a side. The comparison runs in the background, so the page stays usable.
  • Very different texts may take a shortcut: every difference shown is real, but a few unchanged lines may show as removed and added. The page says when that happens.
  • Lists in any order? This tool cares about order. To see which lines two lists share, whatever their order, use Remove Duplicate Lines; for two PDF files, use Compare PDFs.
  • Private: both texts stay on your device and aren’t saved.

Frequently asked questions

How does it decide what changed?
It works out the fewest lines to remove and add to turn the original into the changed text, using Myers’ difference algorithm, the method behind the diff command and git. Then each removed line is paired with the added line in the same place, and if at least half their words are the same, the two are shown as one changed line with the different words marked.
What is the .diff file?
A unified diff, the format the diff -u command writes. Lines starting with a minus sign are only in the original, lines starting with a plus sign only in the changed text, and lines starting with a space are unchanged context, three on each side of a change. The patch command can read it to make the same change to a copy of the original.
Can it compare Word documents or PDFs?
It compares text you paste or type. Copy the text out of each document first. To compare two PDF files directly, use this site’s Compare PDFs tool, which reads the text from the files for you.
Is my text sent anywhere?
No. The comparison runs in your browser, in a background worker on your device. Nothing is uploaded, saved or logged, and closing the page clears both texts.