Guide

How to Compare Two Texts and Spot Every Difference

Learn how text diff tools highlight additions and removals, and how to use them for editing, version control and review.

A text diff compares two versions of a text and highlights what changed — lines or words added, removed, or modified. It is the same idea behind version-control systems, scaled down to two pasted blocks.

How diffing works

A diff algorithm finds the longest common subsequence between two texts, then marks everything else as an addition (in the new version) or a removal (from the old version). Line-level diffs compare whole lines; word-level diffs compare within lines for finer detail.

Reading a diff

  • Unchanged lines appear as plain text.
  • Removed lines (from the original) are marked, often in red or with a minus.
  • Added lines (in the new version) are marked, often in green or with a plus.
  • Modified lines show as a removal plus an addition when compared at word level.

How to compare two texts

  1. Paste the original text in the first field.
  2. Paste the revised text in the second field.
  3. Run the diff and read the highlighted changes.
  4. Use word-level diff for prose and line-level diff for code or lists.

Examples

Original: "The quick brown fox." Revised: "The slow brown fox." A word-level diff highlights "quick" as removed and "slow" as added, with the rest unchanged — making the single edit obvious at a glance.

When a text diff is useful

  • Reviewing edits to an article, contract, or brief.
  • Comparing two versions of a config or code snippet.
  • Checking what changed between drafts.
  • Verifying a find-and-replace did what you expected.

Put it into practice

Use the Text Diff right now — free, in your browser, no sign-up required.

Try the Text Diff