Home › Text Tools › Diff Checker

Diff Checker

Paste two texts and compare them line by line. See which lines were added, removed or unchanged, side by side or in one column.

Each text can have up to 5000 lines. Lines are compared exactly, including line endings and a missing final newline.

Paste two texts to compare them.
Lines added-
Lines removed-
Lines unchanged-
LineOriginalLineChanged
Nothing you paste leaves your browser. The two texts are compared on this page and are not sent, uploaded or stored.

How to use

  1. Paste the earlier version into Original text and the newer version into Changed text. The comparison updates on every keystroke, so there is no compare button.
  2. Read the status line. It says whether the texts are identical, whether changes are shown, or why the input was refused.
  3. Check the three counters: lines added, lines removed and lines unchanged.
  4. Choose Side by side to see the original on the left and the changed text on the right, with line numbers. Choose Inline for a single column with - and + marks.

Worked example

Original text. Both texts here end with a line break after the last line, so press Enter once after the last word:

apple
banana
cherry

Changed text:

apple
blueberry
cherry
date

The tool reports 2 lines added, 1 line removed and 2 unchanged. The inline view reads:

  apple
- banana
+ blueberry
  cherry
+ date

apple and cherry are the longest run of lines that both texts share, so they stay. banana exists only in the original and blueberry and date only in the changed text. The tool does not say that banana "became" blueberry. It reports a removal and an addition, and the side-by-side view puts them on the same row so you can see the pairing.

How it works

Each text is split into lines. A Windows (CRLF) break counts as part of its line, and two lines match only when both their text and their line ending are identical. The comparison then looks for the longest common subsequence: the most lines that appear in both texts in the same order. Everything outside that sequence is a removal or an addition. In each changed block the removed lines are listed before the added ones.

Finding a longest common subsequence is the classic basis of diff tools. The best-known efficient method is described in Eugene Myers' paper An O(ND) Difference Algorithm and Its Variations (1986). The GNU diffutils manual explains how the command-line diff shows the same added and removed lines. Where several equally long common sequences exist, different tools can choose different ones, so the exact pairing may differ from another tool's. The counts of added and removed lines are always consistent with a longest common sequence.

Common mistakes and edge cases

Frequently asked questions

Does it compare characters or words inside a line?

No. It reports whole lines only. A one-letter change shows the whole line as removed and the new line as added.

Why does the identical message not appear when the text looks the same?

The comparison is exact. A missing final newline, trailing spaces or a different kind of line break will count as a difference.

Can I use it for code review?

It suits quick checks of snippets, configuration files and exports. For a repository, use git diff, which also tracks file names and history.

Is my text uploaded?

No. Both texts stay in the page and are not sent or stored.

Why are removed lines shown before added lines?

It is the usual diff convention. Within one changed block the old lines come first, then the new ones.

Related tools