Line Diff Counter Online

Compare two texts and count added, removed, and unchanged lines.

ORIGINAL1 lines
MODIFIED1 lines

When to use Line Diff Counter

Count added, removed and unchanged lines between two short text samples.

How to use Line Diff Counter

Paste the original and modified text, inspect the counts, and enable the detailed diff when needed.

Worked example

Example — verified tool behavior
A
B compared with A
C → 1 added, 1 removed, 1 unchanged

How the tool handles input

The tool splits on newline and uses a longest-common-subsequence table with exact line equality. A replacement counts as one removal and one addition. The total includes unchanged, added and removed diff entries.

Limitations

Trailing newlines create empty entries, and an empty side is split into one empty line. Whitespace and carriage returns are significant. Time and memory grow with the product of both line counts, so large files can freeze the page.

Frequently asked questions

Is total the modified file's line count?

No. It is the number of entries in the combined diff, including removed lines.

What are the main limitations?

Trailing newlines create empty entries, and an empty side is split into one empty line. Whitespace and carriage returns are significant. Time and memory grow with the product of both line counts, so large files can freeze the page.