A text diff compares two versions of a document and highlights exactly what changed — which lines were added, which were removed, and which stayed the same. The tool uses a line-by-line comparison algorithm, which is the same approach used by tools like Git, GitHub's diff view, and code review interfaces.
The diff works by computing the longest common subsequence (LCS) of the two texts, treating each line as a unit. Lines that appear in both texts, in the same order, are marked "unchanged." Lines that appear only in the left text are "removed" — highlighted in red. Lines that appear only in the right text are "added" — highlighted in green.
This is a simplified version of the algorithm used by the diff
command-line utility and by every version control system. It finds the
smallest set of changes that transforms the original text into the
changed text.
The diff view shows the two texts interleaved, line by line:
− marker, red background. These exist in the left text but not in the right.+ marker, green background. These exist in the right text but not in the left.The line numbers on the left of each row show the position in the original text (for unchanged and removed lines) or in the new text (for added lines). This makes it easy to cross-reference back to the source documents.
This tool does line-level diffing. A single character change within a line marks the entire line as "removed" and "added." That's different from a character-level diff (often called "word diff" or "inline diff"), which highlights only the changed characters within a line.
Line-level diffing is standard for code review and document comparison because it preserves context — you see the surrounding unchanged lines, not just a fragment. Character-level diffing is useful for closely comparing two similar sentences, but it can be hard to read in a long document.
The "Similarity" stat shows the percentage of lines that are unchanged, out of the total number of unique lines across both texts. A 100% match means the texts are identical. A 0% match means no lines are shared — though this usually means a completely different structure, not necessarily that the content has nothing in common.