Diff Checker
Compare two texts and see exactly what changed — line by line, word by word.
Both texts are compared in this page and neither is transmitted — which is the reason to use this rather than a site that wants your two contract drafts on their server.
How it works
A diff is not a character-by-character comparison. It is the answer to a harder question: what is the longest sequence of lines the two texts have in common, in order? Everything not in that sequence is what changed. Finding it is the longest common subsequence problem, and every diff tool you have used — git included — is solving it.
The naive dynamic-programming solution needs a table of one cell per pair of lines, which is fine for two documents and hopeless for two large files. This trims the problem first by stripping the identical prefix and suffix, which on a realistic edit removes most of the input before the expensive part starts.
Word mode exists because line mode over-reports. Change one word in a paragraph and a line diff shows the whole paragraph removed and re-added, which tells you nothing. Comparing word by word finds the actual edit. Line mode is right for code and configuration, where a line is the meaningful unit; word mode is right for prose.
The whitespace and case options matter more than they look. A file that has been through a different editor may differ on every single line by a trailing space or a line ending, and a diff that reports two hundred changed lines when nothing changed is worse than useless. Ignoring leading and trailing whitespace usually cuts straight through that.
Common questions
Line or word mode?
Line for code, configuration and data, where a line is the unit that means something. Word for prose, where a line diff shows a whole paragraph changed because you fixed one typo in it.
It says every line changed and I only edited one.
Almost certainly line endings or trailing whitespace — a file saved on Windows and one saved on Unix differ on every line invisibly. Set whitespace to 'ignore leading and trailing' and look again.
How large a file can it handle?
Comfortably into thousands of lines. The identical start and end are stripped before the comparison, so a small edit in a large file is fast regardless of the file's size. Two completely unrelated large files are the slow case.
Is anything uploaded?
No. Both texts stay in your browser.