How the diff works
A diff finds the smallest set of changes that turns one text into another. This tool compares line by line using the classic longest common subsequence (LCS) idea: it finds the longest run of lines the two versions share, in order, then marks everything else as added or removed.
Lines present only in the original are removals; lines present only in the changed version are additions; lines in both, in the same relative order, are unchanged context.
Worked example
Changing "jumps over" to "leaps over" and adding a line:
Reading the result
Each line is prefixed so the change is unmistakable: + and a green background for additions, − and a red background for removals, and a plain background for lines that are the same in both. A summary shows how many lines were added, removed and left unchanged. This line-level view is ideal for prose, config files, logs and code — comparing whole lines rather than individual characters keeps the output readable.