Guide · How-to

How to compare two text files or documents

Paste two versions of any text, see every added, removed and changed line, and use the options to cut out the noise.

The short version

  1. Paste the original and the changed textThe original goes on the left and the new version on the right.
  2. Read the highlighted linesLines only on the left were removed, lines only on the right were added.
  3. Switch on the options you needIgnore whitespace and Ignore case remove differences you do not care about.
  4. Swap if you pasted them the wrong waySwap flips the two sides without retyping anything.

Comparing two versions of a document by reading both is slow and unreliable. A diff does it for you: it lines the two texts up and marks what was removed, what was added and what changed.

The basic comparison

Paste the earlier version on the left and the later one on the right. The editor compares them line by line:

  • lines that exist only on the left were removed
  • lines that exist only on the right were added
  • a line that is on both sides but different is changed, and the part that differs is highlighted inside the line

Remove the noise

Real documents differ in ways you often do not care about.

Ignore whitespace treats extra spaces, tabs and line-ending differences as no change. This is useful when text was copied between programs or re-wrapped.

Ignore case treats Total and total as the same. Use it for text where capitalisation is not meaningful.

Good habits

  1. Paste the older version on the left and the newer on the right, so that "added" means "new".
  2. If a whole block is marked as changed, check whether line breaks were added or removed rather than words.
  3. For code or data, choose the matching language page: it adds checks and tools for that format.

Questions

Can I compare files, not just pasted text?

Open the file in any text editor, copy the contents and paste them into the editor. The comparison works on text.

Is the text I paste sent anywhere?

No. The comparison runs in your browser and nothing you paste is uploaded.

Was this helpful?