Text Diff Checker
Compare two texts line by line and highlight what changed.
About This Tool
The Text Diff Checker compares two blocks of text and shows the differences line by line. Lines only in the original are marked as removed, lines only in the changed version are marked as added, and unchanged lines are shown plainly. It is useful for spotting edits between drafts, config files, code snippets, and pasted documents.
Comparison runs in your browser using a longest-common-subsequence diff, so your text stays private.
- check_circleLine-by-line comparison of two texts
- check_circleAdded, removed, and unchanged lines highlighted
- check_circleGood for drafts, configs, and code
- check_circleRuns in your browser, nothing uploaded
What a diff is actually comparing
A text diff aligns two versions and reports the smallest set of insertions and deletions that turns one into the other. It does not understand meaning, so a paragraph moved from the top of a document to the bottom shows as a deletion in one place and an addition in another rather than as a move. Knowing this prevents a common misreading, where a reorganised document looks like it was rewritten.
Granularity matters too. A line-level diff marks an entire line as changed even if one character differs, which is why a reflowed paragraph can appear entirely rewritten when only a comma moved. A word-level or character-level diff shows the real change inside the line. When reviewing prose, prefer the finer granularity; when reviewing code, line-level is usually what you want because line boundaries are meaningful.
Whitespace, line endings, and phantom differences
A large share of confusing diffs come from characters nobody can see. Windows ends lines with carriage return plus line feed while macOS and Linux use line feed alone, so a file edited on both platforms can show every single line as changed while the visible text is identical. Editors that convert tabs to spaces, or that strip trailing whitespace on save, produce the same effect.
Three more invisible culprits are worth knowing. A byte order mark at the start of a UTF-8 file makes the first line differ. Non-breaking spaces pasted from a web page or a Word document look exactly like ordinary spaces and are a different character. And smart quotes, em dashes, and ellipses inserted by autocorrect differ from their typed ASCII equivalents. If two texts look identical but the diff disagrees, one of these is almost always the reason.
Using a diff for review rather than just detection
The most useful thing a diff does is narrow attention. In a 4,000-word contract, the diff turns a full re-read into a review of six changed clauses, which is both faster and more reliable, because attention holds for six passages and does not hold for 4,000 words.
A few practical habits. Compare like with like: diffing a formatted export against an unformatted original produces noise that buries the real change, so normalise both first. Read deletions as carefully as additions, since removed text is where obligations quietly disappear. Check the surrounding lines of every change, not just the highlighted span, because a change of "shall" to "may" is one word and a complete reversal of meaning. And for anything contractual or regulatory, keep the diff itself alongside the signed version as a record of what was negotiated.
Invisible causes of unexpected differences
| Cause | How it looks | Fix |
|---|---|---|
| CRLF vs LF line endings | Every line marked changed | Normalise line endings first |
| Tabs converted to spaces | Whole indented blocks changed | Compare with whitespace ignored |
| Non-breaking space | One word differs for no visible reason | Replace with an ordinary space |
| Smart quotes and em dashes | Punctuation flagged as changed | Paste as plain text |
| UTF-8 byte order mark | Only the first line differs | Save without BOM |
Frequently Asked Questions
How does the diff work? expand_more
It aligns the two texts using a longest-common-subsequence algorithm, then marks each line as added, removed, or unchanged.
Does it compare word by word? expand_more
It compares line by line, which is the most common and readable way to review changes between two texts.
Is my text uploaded? expand_more
No. The comparison happens entirely in your browser and nothing is sent to a server.