Comparing two versions of a text by eye is slow and error-prone, especially when the change is a single character. A diff does the comparison mechanically: it lines up two blocks of text and marks exactly what was added, deleted and left unchanged.
What a diff shows
- Added lines: present in the new version but not the old.
- Removed lines: present in the old version but not the new.
- Unchanged lines: identical in both, shown as context.
Most tools colour additions green and removals red, mirroring the convention developers have used for decades in version control.
Line diff vs word diff
A line diff treats each line as a unit and is ideal for code, lists and configuration files. A word (or character) diff drills into a changed line and highlights the exact words that differ, which is better for prose. If you changed "15% discount" to "20% discount" on a long line, a line diff shows the whole line as changed, while a word diff points at the "15" and "20".
A worked example
Suppose the old text is:
Shipping is free on orders over $50.
Returns accepted within 30 days.
Support is open Monday to Friday.
And the new text is:
Shipping is free on orders over $75.
Returns accepted within 30 days.
Support is open seven days a week.
The diff marks line 1 as removed and re-added (50 became 75), line 2 as unchanged, and line 3 as changed (Monday to Friday became seven days a week). Three lines, two edits — invisible to a quick glance, obvious to a diff.
Common uses
| Situation | Why a diff helps |
|---|---|
| Editing an article | See the editor's changes without re-reading everything. |
| Reviewing code | Spot a changed condition or variable before it ships. |
| Comparing contracts | Find altered clauses between two drafts. |
| Checking config files | Confirm one setting changed and nothing else. |
Whitespace, case and ordering traps
Two texts can look identical but differ in trailing spaces, tabs or line endings, producing noisy diffs. Many checkers offer an option to ignore whitespace or ignore case so only meaningful changes stand out. Also remember that reordering lines counts as a change even when no line's content changed — a diff cannot tell a move from a delete-plus-add.
How to run a comparison
- Paste the original text into the left panel.
- Paste the revised text into the right panel.
- Read the highlighted result: green is new, red is gone, plain is shared.
- Decide whether each change was intended before you accept it.
Paste both versions into our diff checker to highlight every added and removed line instantly. If you are reviewing prose, you may also want the character limits guide to check a trimmed description still fits its limit.