Text Diff

Compare two texts side by side and highlight the differences line by line.

Text Diff
Original
Changed

📐 How to Use

  1. Paste the original text in the left panel (labelled "Original").
  2. Paste the new or modified text in the right panel (labelled "Changed").
  3. The diff view updates automatically — green lines are additions, red lines are deletions.
  4. Enable "Ignore whitespace" to skip changes that only differ in spaces or tabs.

🎯 When to Use This

  • Comparing two exports of a config file before a release shows which settings actually moved, instead of reading both versions in parallel.
  • Editors who get a draft back from a reviewer can see the added and removed lines without relying on a word processor's tracked changes.
  • Support engineers handed two API responses that should match can locate the one differing line in seconds.
  • Confirming that a long licence key or a pasted block of text arrived intact is a matter of diffing it against the source.

❓ Frequently Asked Questions

QWhat do the colours mean?
Green lines are additions (in the new text but not the original). Red lines are deletions (in the original but not the new text). Uncoloured lines are unchanged.
QCan I compare code?
Yes — Text Diff works on any plain text including code, config files, CSV data, and prose.
QIs my text sent to a server?
No. All diffing is done in JavaScript in your browser. Your text never leaves your device.

ℹ️ About This Tool

A diff is the smallest set of insertions and deletions that turns one text into another, normally derived from the longest common subsequence. The unit of comparison decides what you see. Compare lines and a one-word edit appears as a whole line deleted and a near-identical line added. Compare words and you see the edit itself, but the output turns noisy on anything long.

This tool splits both texts on newlines and runs the LCS over lines, so the granularity is a whole line with no word-level highlighting inside it. Ignore whitespace collapses runs of spaces and tabs to a single space and trims each end before comparing; Ignore case lowercases both sides. Both affect matching only, and the original lines are displayed. The result is one unified column with plus and minus gutters and a tally of added, removed and unchanged lines, computed in your browser.

⚠️ Notes & Limits

  • Changes are reported per line, so a single altered word shows as the whole line removed and re-added; use a word-level diff when you need that detail.
  • Ignore whitespace trims each line and collapses internal runs, which hides indentation-only changes, so leave it off for Python, YAML or Makefiles.
  • A moved block appears as a deletion in one place and an addition in another, because the algorithm has no concept of a relocated line.
  • The comparison builds a table proportional to the two line counts multiplied together, so two very long files are slow and memory-hungry to compare.