Skip to content

Developer Tools

Diff Checker

Paste two versions of a text to see exactly what changed — added lines in green, removed lines in red. Perfect for comparing drafts, code or documents. Runs entirely in your browser, nothing uploaded.

Developer Tools · Diff CheckerRuns in your browser
+1 added−1 removed
Roses are red
Violets are blue
−Sugar is sweet
+And so are you

How to compare two texts line by line

  1. Paste the earlier version into Original text on the left and the later version into Changed text on the right, replacing the sample poems.
  2. Read the totals: +N added in green and −N removed in red.
  3. Scroll the Differences panel. Lines marked + exist only in the changed text, lines marked − only in the original, and unmarked lines are identical in both.
  4. Edit either box and the comparison recalculates as you type.

The algorithm behind the highlights

Both texts are split into lines, and the tool finds the longest sequence of lines that appears in the same order in both versions (the longest common subsequence). Those lines are shown unchanged; every original line outside that sequence is a removal and every changed line outside it is an addition. This is the same idea used by version-control diffs, applied to whole lines with no character-level comparison.

With the sample poems, the first two lines match and form the common sequence, so the output is two plain lines, '− Sugar is sweet' and '+ And so are you', with the totals +1 and −1. Inserting a line keeps the rest aligned: comparing 'a, b, c' with 'a, x, b, c' shows only '+ x', not three changed lines.

What counts as a different line

Two lines are equal only if they are identical character for character. Anything else is a removal followed by an addition.

OriginalChangedResult
hello worldhello world (trailing space)−1 +1, the lines look the same
Hellohello−1 +1, case matters
four spaces of indentone tab of indent−1 +1, whitespace is compared literally
Two lines with Windows line endingsThe same two lines with Unix line endingsThe first line differs because its invisible carriage return is kept; the last line matches only because nothing follows it
a, ba, b, blank final line+1 empty line, a trailing line break adds an empty line
a, b, c, db, c, d, a−1 +1, a moved line is shown as removed and re-added

Reading the counters

  • A line you edited counts once as removed and once as added; the totals do not report 'modified' lines separately.
  • Where the algorithm could list a removal or an addition first, it shows the removal first, so a changed block reads as old lines then new lines.
  • The + and − symbols in the left column are not selectable, and long lines wrap inside the panel instead of scrolling sideways.
  • Two empty boxes show one blank unchanged line, because an empty text is still one (empty) line.

When everything shows as changed

If almost every line is both red and green, the versions usually differ in something invisible rather than in content. The common causes are Windows versus Unix line endings after one copy passed through a different editor, tabs replaced by spaces by a code formatter, trailing spaces added by an editor, and straight quotes turned into curly quotes by a word processor. Normalise both texts with the same editor, or paste them into the Text Case Converter or a plain-text field first, then compare again.

Size and performance

The comparison builds a table with one cell for every pair of lines, so the work grows with the product of the two line counts. Two texts of 1,000 lines need a million cells and finish instantly; 5,000 lines each need 25 million and take a noticeable moment; tens of thousands of lines on each side can stall the page or run out of memory. For very large files, compare one section at a time.

Frequently asked questions

How does the diff checker work?

It compares the two texts line by line and marks lines that were added (green) or removed (red), leaving unchanged lines plain.

Can I compare code?

Yes. It works for any plain text — code, prose, config files or documents — and preserves spacing in a monospace view.

Is my text private?

Completely. The comparison runs entirely in your browser, so nothing is uploaded — safe even for sensitive content.

Is it free?

Yes, free with no sign-up or limits.

Does it highlight which words changed inside a line?

No. The comparison is per line, so an edited line appears in full as a red removal and a green addition. To spot a one-word change, read the two lines side by side.

Can I ignore whitespace or case differences?

There is no option for that. Make both texts consistent first, for example by running them through the Text Case Converter's lowercase button or re-indenting in your editor.

Can I compare two files directly?

Not by upload. Open each file, copy its contents and paste it into the corresponding box; the tool handles any plain text including code and configuration files.

Explore

113 tools. Zero uploads. One place.

Every tool opens instantly, works on your phone and keeps your files on your device.

Diff Checker guides