TheFileTools

How to compare two texts and find the differences

Paste two versions of a document, a list or a config file and see which lines were added or removed.

Two versions of a contract clause, a list before and after someone edited it, a settings file that worked yesterday. Reading both side by side and hoping to spot the change is unreliable.

Steps

  1. Open Compare two texts.
  2. Paste the older version into Original.
  3. Paste the newer version into Changed.
  4. Read the result below. It updates as you edit either box, and neither text leaves your device.

Reading the result

A summary line gives the number of lines added and removed. Under it is the full text, with a plus sign in front of lines that exist only in Changed and a minus sign in front of lines that exist only in Original. Lines without a sign are the same in both. When there is no difference at all, the page says the two texts are identical.

The comparison works on whole lines. A line where one word was edited is shown as two lines, the old one removed and the new one added, and the changed word inside it is not highlighted. Long paragraphs that sit on a single line are therefore hard to compare. Break them into shorter lines first, for example one sentence per line.

Differences you did not expect

Lines have to match exactly, including capitals and spaces. If nearly every line is marked, the cause is usually invisible.

  • Spaces at line ends or different indentation: run both texts through Clean up text and compare again.
  • The same items in a different order: a moved line counts as removed in one place and added in another. For lists where order does not matter, put both through Sort lines first.
  • Different line wrapping: text copied from a PDF breaks at other places than the source. Remove line breaks helps for single paragraphs.

Limits

This is a plain text comparison. It does not read Word or PDF files and knows nothing about formatting such as bold. The result cannot be exported, so copy what you need from the page.