HomeGuides › Compare text

How to compare two versions of a text

Two drafts, two config files, two copies of a contract. Reading both is slow and unreliable; comparing them is neither.

People are poor at spotting differences by reading. A single changed digit in a long document is nearly invisible, and it is often the one that matters.

Step-by-step

  1. Paste the original on the left.
  2. Paste the new version on the right.
  3. Read the marked differences — added, removed and changed.

Reading the result

Lines present only in the new version are additions; lines only in the original are deletions. A changed line usually appears as both, since a modification is a deletion and an addition in the same place.

That is why a small edit to a long paragraph can look like the whole paragraph changed — if the text is one long line, the smallest edit rewrites that line. Comparing works best on text broken into reasonably short lines.

What it is good for

Whitespace

Trailing spaces and different line endings produce differences you cannot see, which is confusing when two lines look identical and are marked as changed. If everything appears different, suspect line endings — a file written on Windows and one written on a Mac differ on every single line.

Nothing is uploaded. Both texts stay in your browser, which matters when comparing two versions of something confidential.

Frequently asked questions

Is my text uploaded?

No. Both versions are compared in your browser and neither is transmitted.

Why is every line marked as different?

Almost certainly different line endings between the two sources — one written on Windows, the other on a Mac or Linux. The visible text is identical; the invisible characters at the end of each line are not.

Can I compare two files rather than pasting?

Paste the contents of each. For very large files, comparing the relevant sections is usually more informative than the whole thing anyway.

Open the everyday tools →