Spotting the Differences
Comparing two versions of a document by eye is tedious and error-prone. A 'diff' tool automates this process, highlighting exactly what has been added, removed, or changed.


How It Works
Diff tools use algorithms to find the 'Longest Common Subsequence' (LCS) between two texts. This allows them to identify the minimal set of changes needed to transform one text into the other.
The LCS Algorithm
Imagine finding the longest string of characters that appear in the same order in both texts. Everything else is treated as an insertion or deletion.
Who Uses This?
Programmers
To track changes in source code (Git diffs) and review pull requests.
Writers & Lawyers
To compare different drafts of a contract or manuscript to ensure no unauthorized changes were made.


Learn More
Read about the history and algorithms of the Diff utility.