Text Compare (Diff Checker)

Paste two versions of a text to see exactly what changed.

Original
Changed

How it works

The tool compares the two texts line by line and finds the longest run of lines they share. Lines only in the original are shown in red with a minus, lines only in the changed text in green with a plus.

Uses

FAQ

Is anything uploaded?

No. Everything happens in your browser and nothing is sent to a server.

Comparing two texts

  1. Paste the earlier version into Original and the newer version into Changed.
  2. Decide whether small differences should be ignored: "Ignore case" treats upper and lower case as the same, and "Ignore whitespace" collapses runs of spaces and tabs into one space and trims the line ends before comparing.
  3. Press Compare. The result is only produced when you press the button; editing the boxes does not update it automatically.
  4. Read the summary, such as "3 added, 1 removed". Lines with a green "+" exist only in the changed text, lines with a red "-" exist only in the original, and unmarked lines are the same in both.

How the comparison is calculated

Each text is split into lines, and the tool finds the longest common subsequence of lines: the largest set of lines that appear in both texts in the same order. It builds a table of these lengths and then walks through it to decide, line by line, whether to keep a shared line, mark one as added or mark one as removed. Everything outside the shared lines is reported as a change.

This is a line-based comparison. If you edit a single word inside a line, the old line is shown as removed and the new line as added; the tool does not highlight the individual word. A modified line is therefore always shown as a minus and plus pair.

When the ignore options are on, the comparison uses normalised copies of the lines, but the output always displays your original text, so you can still see the real spacing and capitalisation.

Worked example

Original:

Dear Sam, / Please send the report by Friday. / Thanks, / Alex

Changed:

Dear Sam, / Please send the report by Monday. / Thanks, / Alex

"Dear Sam," "Thanks," and "Alex" are shared, so they appear unmarked. The Friday sentence is shown with a minus and the Monday sentence with a plus: "1 added, 1 removed". If the only change were a capital letter, ticking Ignore case would turn the result into "The texts are identical."

Common uses

Tips and limits

More questions

Why does a one-word change mark the whole line?

The comparison works on whole lines. Splitting your text into shorter lines, for example one sentence per line, makes the changes easier to pinpoint.

What does "The texts are identical" mean exactly?

With the chosen options applied, every line matched. With ignore options on, the texts can still differ in capitalisation or spacing.

Can it compare files?

Not directly. Open the file in a text editor, copy the contents, and paste them into the boxes.