All tools
Developer

Text Diff Checker

Line-by-line comparison of two texts, with added/removed lines highlighted.

🔒 Runs entirely in your browser — nothing here is ever uploaded

About the Text Diff Checker

Compares two blocks of text line by line and highlights added and removed lines, using a Longest Common Subsequence algorithm — the same textbook foundation Unix diff and git use to find the minimal set of changes between two versions of text.

100% Free Runs in Your Browser No Sign-Up Required
How to use it
  1. Paste your original text on the left and the changed text on the right.
  2. Optionally toggle Ignore case or Ignore leading/trailing whitespace.
  3. Read the line-by-line diff, with added lines in green and removed lines in red.
Formula
Uses dynamic-programming Longest Common Subsequence (LCS): dp[i][j] tracks the length of the longest matching subsequence of lines between the remaining portions of both texts, built from the end backward. Reading that table forward reconstructs the minimal edit script — which lines are unchanged, added, or removed — the same conceptual foundation as Unix diff and git's line-diff output (without Myers' greedy-path speedup, which produces the same result faster on very large inputs).
Worked example

Comparing "jumps over the lazy dog" against "jumps over the lazy cat" (with identical lines before and after): the diff shows 1 line removed (dog) and 1 line added (cat), with the surrounding identical lines marked unchanged.

Interpreting your result

Comparison happens entirely client-side — no text is sent anywhere. Ignore case and Ignore whitespace only affect which lines are treated as 'equal' versus 'changed'; the displayed line text is always your original, unmodified input. Input is capped at 5,000 lines per side, since the algorithm's work grows with the product of both texts' lengths — larger inputs would freeze the page rather than finishing quickly.

Recommendations
  • Use Ignore whitespace when comparing code or config files reformatted by a linter — it strips leading/trailing whitespace and collapses internal runs of spaces before comparing.
  • Use Ignore case when comparing text where capitalization doesn't matter to you (e.g., checking if two paragraphs say the same thing regardless of styling).
  • For very large files (beyond 5,000 lines per side), split the comparison into smaller sections — the algorithm's cost grows with the product of both lengths.
Frequently asked questions
No — the entire comparison runs in your browser; nothing is uploaded or transmitted.