How to Compare Two Texts and Spot Differences

How to Compare Two Texts and Spot Differences

Two versions of the same document. One of them changed, and nobody remembers what. Reading both side by side and hoping you spot the difference is slow, boring, and unreliable — humans miss changed words in familiar text with embarrassing ease. A diff tool does it properly: it lines the two texts up, and shows exactly what was added, removed or changed. This guide explains how diffing works, when to use it, and how to read the result.

The quickest way is our free Text Diff Checker. Paste the original text on the left and the changed text on the right, press “Compare texts”, and added lines show in green with a + sign, removed lines in red with a − sign, and unchanged lines stay plain. The comparison runs entirely in your browser — neither text is sent, stored or shared.

What a diff is

A diff is the difference between two texts, computed by an algorithm rather than by eye. The classic approach compares line by line: it finds the longest sequence of lines the two versions share, in order, and everything else is an addition or a removal. A changed line is really a removal plus an addition — the old line goes, the new line arrives — which is why a diff shows a changed sentence as a red line followed by a green line, rather than highlighting the single changed word inside it.

That line-based view is a deliberate choice. It is the same approach used by programmers comparing code, and it has a useful property: the summary can count. “Two lines added, two removed, out of twelve” tells you at a glance whether a document was tweaked or rewritten. A word-level diff is prettier for a single sentence but useless for a ten-page contract, because it cannot give you that count.

How to compare two texts

  1. Open the Text Diff Checker.
  2. Paste the original text into the first box and the changed text into the second.
  3. Tick “Ignore case” if “Fox” and “fox” should count as the same, or “Ignore leading / trailing spaces” if extra spaces at the ends of lines should not count as changes.
  4. Press “Compare texts” and read the result: green lines with + were added, red lines with − were removed, plain lines are unchanged.

Worked example: three lines, three outcomes

Take three lines: “The quick brown fox jumps over the lazy dog.”, “Freetoolza offers free online tools.”, and “No signup is needed.” Now change the first line’s “jumps” to “leaps”, keep the second line, and replace the third with “Sign up today for extra features.” The diff reports 2 added lines and 2 removed lines out of 3: the first line shows as a red removal (“jumps”) plus a green addition (“leaps”), the second line stays plain, and the third shows as a removal plus an addition. The summary tells you the scale of the change in one line, and the coloured lines tell you exactly where it happened.

Notice what the diff does not do: it does not tell you whether “leaps” is better than “jumps”. Diffing is a mechanical comparison, not an editorial judgement. It finds what changed; deciding whether the change is good is still your job.

When diffing saves the day

The classic use is contracts and legal documents: a counterparty returns a revised agreement, and the diff shows every altered clause before you sign — including the one quietly changed on page seven. Writers use it to check what an editor actually changed. Developers use it on configuration files, where one changed line can take a server down. And anyone who has ever pasted the wrong version of a document into an email can use it to find out which version was which.

It is also the fastest way to check whether two files that should be identical actually are. If the tool reports “identical”, you know for certain; if it does not, you know exactly where they differ. Guessing is replaced by a count.

Frequently asked questions

What is a text diff used for?

Checking what changed between two versions of the same text — an edited article, a revised contract, a config file, or code. It beats reading both versions side by side and hoping you spot the change.

Does it compare word by word or line by line?

Line by line first: a changed line is shown as one removed line plus one added line. Within the summary you can see at a glance how many lines were added and removed out of the total.

Is my text uploaded anywhere?

No. The comparison runs entirely in your browser using a line-matching algorithm. Neither text is sent, stored or shared.

Compare your texts now with the Text Diff Checker. For cleaning up the text once you know what changed, the Find and Replace tool fixes repeated errors in one pass, and the Text Separator re-formats lists that a diff has exposed as messy.