How the comparison is calculated
The checker splits each box into lines and finds the longest common subsequence (LCS) of lines. That is the longest list of lines that appear in both texts in the same order. Every line outside that list is either a deletion from the original or an addition in the changed text. The result is a minimal set of line edits, though not necessarily the one a human would choose when several are equally small.
It uses Myers' O(ND) algorithm, the same family of method as git diff. The work grows with the number of lines that differ, not with the product of the two file sizes, so two 20,000-line files with a handful of edits compare instantly. Lines that are identical at the start and end of both texts are skipped first. There is one limit: if the two texts differ by more than 3,000 lines (additions plus deletions), the tool stops and shows a "too much to compare" message instead of risking a frozen tab. In that case compare smaller sections, or use a command-line tool such as git diff.
Worked example
Compare a, b, c, d with a, B, c, d, e (one line each):
a
- b
+ B
c
d
+ e
The counters read 2 additions, 1 deletion and 3 unchanged. The edited line shows as a deletion followed by an addition, because the checker works on whole lines and highlights nothing inside a line. When the algorithm could place a deletion or an addition first, it puts the deletion first.
The two options
- Ignore case lower-cases both lines before comparing. With it on,
bandBcount as unchanged. - Ignore whitespace collapses each run of spaces and tabs to one space and trims the line ends.
x yandx ythen match, but a missing space (xy) still differs.
Unchanged lines are displayed using the original text, so a case or spacing difference you chose to ignore is invisible in the output. Blank lines are compared too, so an extra empty line at the end counts as an addition.
Reading the results well
- A moved paragraph appears as a deletion in one place and an addition in another, since the tool does not detect moves.
- If almost everything is marked changed, suspect reflowed hard-wrapped text. Wrapping the same sentence at another width changes every line.
- For structured data, format both sides the same way first. Run two JSON blobs through the JSON formatter so that key layout does not drown out real changes.
- To rewrite text across a file after spotting a pattern, use find and replace.
The output is a view on screen only. It does not produce a unified diff or patch file, so copy the highlighted lines manually if you need to share them.