Skip to main content

Text Diff

Paste the original and modified text into each panel to see exactly what changed. Additions are highlighted in green, removals in red. Options to ignore case and whitespace — all browser-side.

FreeLCS AlgorithmLine-by-lineNo Upload

Original

Modified

How the LCS diff algorithm works

The Longest Common Subsequence (LCS) algorithm finds the largest set of lines that appear in the same order in both texts. Lines not in the LCS are marked as either removed (only in the original) or added (only in the modified version). This produces the minimal edit — the fewest possible additions and removals — which is the same approach git, Unix diff, and most code review tools use.

Practical uses for text comparison

  • Reviewing changes to configuration files, legal documents, or article drafts.
  • Comparing two versions of a script, README, or changelog.
  • Spotting differences between two API responses pasted as JSON.
  • Verifying that a translation or rewrite preserved the intended structure.