Diff Checker — Compare Lines of Text

Compare two texts line by line with added, removed and unchanged counts. Optionally ignore case or normalize whitespace within lines.

🔒 Local processing
⚡ Free to use
🌐 Runs in your browser
📦 See output options
⚡

Diff Checker — Compare Lines of Text

Tool workspace

Ready

Loading tool...

  1. Paste the original and revised texts.
  2. Choose whether to ignore case or normalize whitespace.
  3. Click Compare to see line additions and removals.
  4. Swap exchanges the inputs and clears the previous comparison.

Read line additions and removals

This tool aligns lines using a longest-common-subsequence calculation. A changed line appears as a removal and an addition, not an inline character edit. Original and revised line numbers help locate changes. Repeated identical lines can allow more than one valid alignment; this view is one alignment, not a reconstruction of the editing history.

Choose what counts as equal

Ignore whitespace collapses runs of whitespace within a line to one space and trims its edges; it does not remove all spaces. Ignore case applies JavaScript lowercase comparison. Both options affect matching, while unchanged rows display the original text. CRLF, CR and LF are treated as line separators. A terminal newline creates a final empty line; a completely empty input has zero lines.

Size and scope

Each side is limited to 200,000 UTF-16 units and 2,000 lines. The comparison matrix, including its boundary row and column, must not exceed one million cells. Excess input is rejected before allocating the matrix. The tool displays escaped text and does not execute pasted HTML. It is not a code parser, merge tool or patch exporter. Editing inputs or options clears the previous result.

Frequently asked questions

Does it compare individual characters?

No. It compares whole lines; a changed line is removed and added.

Does Ignore whitespace remove every space?

No. It trims line edges and collapses whitespace runs to one space.

Why are large texts rejected?

The line-alignment matrix grows with both line counts. Explicit limits prevent excessive memory use.