Yueseryueser.com

← All guides

Compare two texts line by line and see what was added or removed

Paste the old version on the left and the new one on the right, then compare. The tool walks both texts line by line and marks additions with + and deletions with -, leaving unchanged lines grey, with line numbers from each side. Matching uses the longest common subsequence, and everything runs in your browser.

Open the tool:Text Diff

When a line diff is what you need

After editing a config, a piece of copy or a contract clause, the real risk is not the edit you made — it is the paragraph you deleted by accident. A line diff puts every change in front of you instead of asking you to trust your eyes.

Taking over someone else's file, checking a translation for dropped paragraphs, or confirming what changed between two exported configs are the same job. Scanning two long documents by eye is not a reliable way to catch a missing line.

How matching works, and the two options

Comparison is per line, using the longest common subsequence, so the result approximates the smallest set of edits rather than a naive line-by-line alignment. Because matching is at line granularity, changing one word inside a line takes that line out of the common subsequence: it appears as a deletion and an addition, highlighted as a full red line and a full green line.

Whitespace ignoring strips leading and trailing whitespace from each line before comparing. Case ignoring lowercases both sides before matching, and the rendered output shows the lowercased text while keeping the original line numbers. Windows CRLF and Unix LF are treated as the same line break, so a line-ending conversion will not flag the whole file.

Alternatives and size limits

A few hundred to a few thousand lines per side is comfortable in a browser. Beyond that, be careful: the LCS table is left lines × right lines, so doubling both sides roughly quadruples time and memory. Tens of thousands of lines can hang the tab.

At that scale, move to the command line: git diff --no-index for two arbitrary files, diff -u for a standard patch, diff -y for side-by-side output. For word-level highlighting, use an editor with inline diff or git diff --word-diff.

FAQ

I changed one word — why is the whole line marked as deleted and added?

Because matching is line-based: only lines that are exactly equal count as unchanged. A line with one word changed is not part of the common subsequence, so it shows up on both the deletion and the addition side. This tool does no character-level diff. For word-level highlighting, use an editor with inline diff or git diff --word-diff.

How large a text can it handle?

It depends on the product of the two line counts. The LCS table is left lines × right lines: a thousand lines each is around a million cells and usually fast; ten thousand each is over a hundred million, which strains memory and can freeze the tab. Keeping both sides within a few thousand lines is safer; larger files belong on the command line.

I ignored whitespace — why are there still differences?

The option only affects whitespace at the start and end of each line: it is stripped before comparing, so a pure indentation or trailing-space change disappears. Remaining differences mean the line content itself changed, or lines were added or removed. To remove formatting noise entirely, run both sides through the same formatter first.

Related tool:Text Diff