How the comparison works
The first pass finds the longest common subsequence of lines between the two texts. That is the standard way to diff: rather than comparing line one against line one and getting confused the moment a line is inserted, it finds the largest set of lines that appear in the same order in both, and treats everything else as an addition or a removal.
The second pass makes the result readable. When a removed line is immediately followed by an added line, the two are compared word by word, and if they are similar enough they are treated as a modification of the same line rather than as an unrelated deletion and insertion. The removed row then highlights only the words that went, and the added row only the words that arrived.
That word-level step is what separates a useful diff from a frustrating one. Without it, correcting a typo in a long paragraph shows the entire paragraph as deleted and a nearly identical paragraph as added, and you are left hunting for the actual change yourself.
- Longest common subsequence over lines, so insertions do not desynchronize the comparison
- Similar adjacent removed and added lines are paired as modifications
- Word-level highlighting shows exactly which words moved
Reading the result
The output is a single unified column rather than two side-by-side panes. Every row carries the line number from the original text, the line number from the changed text, and a marker: a plus for an added line, a minus for a removed one, and a space for an unchanged one. Added and removed rows are tinted, and within a modified pair the changed words are highlighted more strongly.
Three counters sit above the diff: added lines, removed lines, and unchanged lines. A modified line increments both the added and removed counts, since it appears as one of each in the output. Those numbers are the quickest way to sanity-check that you pasted the right two versions.
The copy button produces a patch-style text with the same plus, minus, and space prefixes, which pastes usefully into a review comment, a ticket, or an email. There is no side-by-side export and no HTML output.
What it compares exactly, and what that means
Comparison is strict at both the line and word level. There is no ignore-case option and no ignore-whitespace option, so a line differing only in capitalization or only in the number of spaces counts as changed. That is the right default for code and data, where those differences are real, and occasionally annoying for prose, where they usually are not.
The one normalization applied is line endings. Windows carriage-return-newline pairs and lone carriage returns are converted to plain newlines before anything else, so pasting one text from a Windows file and the other from a Unix file does not show every single line as changed.
The comparison builds a full table sized by the line counts of both texts, so the work grows with the product of the two rather than with their sum. For paragraphs, documents, and configuration files that is instant. For two very large files it will get slow, and a dedicated desktop diff tool is the better instrument at that scale.
- Strict comparison: case and whitespace differences count as changes
- Line endings are normalized, so Windows and Unix text compare correctly
- Effort grows with the product of the two line counts, so very large files are slow