Understanding text diffing
Whether you are reviewing code, editing a contract or checking what changed between two versions of a config file, spotting differences by eye is slow and unreliable. A diff tool compares the two versions and shows exactly which lines were removed, which were added and which stayed the same.
How to read the result
- Red lines exist only in the original: they were removed or changed.
- Green lines exist only in the changed version: they were added or changed.
- When a line was edited rather than replaced outright, the specific words that changed are highlighted in a darker shade, so a one-character fix doesn’t get lost in a long line.
- Long stretches of identical lines are folded away, leaving three lines of context around each change. Click a fold to expand it.
Side-by-side or unified?
The side-by-side view puts the two versions in parallel columns, which is easiest to scan when lines were edited in place. The unified view is the format used by git diff and code review tools: one column, with removed lines marked − and added lines marked +. It works better on narrow screens and for changes where lines moved around.
How the comparison works
The checker uses the Myers diff algorithm, the same approach behind Git and GNU diff. It finds the longest common subsequence of lines, meaning the largest set of lines that appear in both versions in the same order, and treats everything else as an insertion or a deletion. That gives the smallest possible set of changes, so a single inserted line near the top doesn’t make every following line look different. The same algorithm then runs on the words inside each edited line to produce the inline highlights.
Ignore options
Ignore whitespace treats lines as equal if they differ only in indentation, trailing spaces or the amount of space between words, which is useful after reformatting code. Ignore case treats upper and lower case letters as the same. Lines that match only because of these options are shown as unchanged.
Privacy
The comparison runs entirely in your browser. Nothing you paste is uploaded or stored.