Diff Viewer

Free text diff viewer. Compare two blocks of text line by line and see exactly what was added, removed, or unchanged.

Frequently asked questions

What is an LCS diff?

LCS stands for Longest Common Subsequence โ€” the algorithm finds the longest sequence of lines that appears, in order, in both texts. Everything in that shared sequence is marked unchanged; lines outside it are marked as added or removed. It's the same core approach used by command-line tools like diff and by Git.

Does this diff compare word-by-word or character-by-character?

No โ€” it compares whole lines. If a single word changes in an otherwise identical line, that entire line is shown as one removed line and one added line, rather than highlighting just the changed word within it.

Why is there a 2,000-line limit?

LCS-based diffing runs in browser JavaScript here rather than on a server, and its cost grows with the size of both inputs. Capping each side at 2,000 lines keeps comparisons fast and the tab responsive for any pair of documents you're likely to compare by hand.