ToolsForWeb

Text Diff

See a line-by-line and word-by-word comparison of two blocks of text, with additions and deletions highlighted.

Loading tool…

About this tool

Compare two blocks of text and see what changed. The comparison runs in two passes: a line diff (a longest-common-subsequence pass over the two line arrays, backtracked into unchanged, added and removed rows) and then, wherever a removed line is immediately followed by an added one, a word diff over that pair so you can see which words moved. Added rows are tinted green with a + gutter, removed rows red with a -, and within a changed line the specific words are highlighted. 'Ignore whitespace' compares lines with runs of spaces collapsed and the ends trimmed, so re-indented or re-wrapped lines still count as unchanged. This is a textual diff, not a semantic or three-way merge: it has no notion of syntax, moved blocks or conflict markers. Inputs over 200,000 characters combined are not compared.

When to use it

Checking what changed between two versions of a config file, email draft or block of prose.
Reviewing a paste from a colleague against your local copy before merging the edits by hand.
Spotting an unintended change in generated output — minified CSS, a lockfile, an API response.
Confirming two files that should be identical really are, down to whitespace.

Questions

How does it decide a line was changed rather than deleted and re-added?

It does not, exactly — the line diff only produces added, removed and unchanged rows. When a removed row is directly followed by an added row, the tool treats that as a changed line and runs a word-level diff over the pair, showing both rows with the differing words highlighted. A deletion and an insertion that are not adjacent stay separate.

What does 'Ignore whitespace' actually compare?

For the equality test it collapses every run of whitespace in a line to a single space and trims the ends, so ' foo( a, b )' and 'foo( a, b )' match. The rows still show your original text unchanged; only the matching is affected.

Is this a merge tool?

No. It shows the difference between two blocks but never combines them, and it has no three-way mode, no base revision and no conflict resolution. Use it to understand a change, then apply the edit yourself or in your editor or version-control tool.

Why did a large paste show nothing?

The line diff builds an n-by-m table, so there are two hard caps: the two inputs together may not exceed 200,000 characters, and the line counts multiplied together may not exceed about four million. Past either one the tool stops and tells you instead of locking up the tab. Diff a smaller section at a time.

Related tools