tomai
Log in
Free · Text Tools

Text Diff

Compare two blocks of text line by line, with added/removed highlighted

Original
Modified

What Is a Text Diff?

A text diff compares two versions of a document and shows what actually changed between them, line by line. Reading a new draft against the old one, or a config file before and after an edit, the eye easily misses single-line changes; a diff marks every added and removed line so nothing slips past. The comparison finds the longest common sequence of lines, so scattered small edits and large rearrangements both surface clearly. Editors, developers and anyone who reviews other people's copy will find it indispensable. The output reads like a review screen — every change visible in one pass, with unchanged lines supplying the context a plain summary would lack.

What the comparison shows

  • ➕ Added lines highlighted in green
  • ➖ Removed lines highlighted in red
  • ✔️ Unchanged lines kept for context
  • 📊 Running totals of added, removed and unchanged lines
  • ⌨️ Paste both versions side by side and compare instantly

When comparing pays off

  • Reviewing an editor's changes to a draft you wrote
  • Spotting what a find-and-replace actually altered in a config file
  • Verifying a teammate's copy edits before publishing
  • Confirming two exports differ only where you expect

The whole comparison happens in your browser; neither version of your text is uploaded, so it is safe to diff contracts, source code or anything else confidential.

How the differences are computed

  • A longest-common-subsequence over lines, grouped into change blocks — the classic diff model, computed locally.
  • Line mode never matches partial lines: one changed word marks the whole line, keeping reviews honest.
  • Whitespace-only churn is flagged separately so indentation noise cannot hide real edits.

A diff you can read beats one you can debug

Line-level precision

A longest-common-subsequence match pairs identical lines between the two versions, then marks every added line green and every removed line red — nothing in between is guessed at.

🔒

Change counts in the bar

Above the result, a running tally states exactly how many lines were added and how many removed, so a ten-line edit versus a hundred-line rewrite is visible before you read a single row.

🎯

Spot checks and clean copies

Compare a draft against its earlier version, a config file before and after a change, or two exports of the same list — when nothing differs, the result says so plainly.

Frequently asked questions

Does this compare word-by-word or line-by-line?

Line-by-line. Each line is treated as a single unit, so a change in the middle of a line marks that whole line as removed-then-added rather than highlighting the exact changed word.

What algorithm does the comparison use?

A classic longest-common-subsequence (LCS) line diff — the same family of algorithm behind tools like "diff" and Git's line-level comparisons.

Is my text uploaded anywhere?

No — the comparison runs entirely in your browser. Neither text block is ever sent to a server.

Related tools

Related tools