Text Diff
Compare two blocks of text and highlight what changed.
Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.
About this tool
Compare two blocks of text and see what changed. The comparison runs in two passes: a line diff (a longest-common-subsequence pass over the two line arrays, backtracked into unchanged, added and removed rows) and then, wherever a removed line is immediately followed by an added one, a word diff over that pair so you can see which words moved. Added rows are tinted green with a + gutter, removed rows red with a -, and within a changed line the specific words are highlighted. 'Ignore whitespace' compares lines with runs of spaces collapsed and the ends trimmed, so re-indented or re-wrapped lines still count as unchanged. This is a textual diff, not a semantic or three-way merge: it has no notion of syntax, moved blocks or conflict markers. Inputs over 200,000 characters combined are not compared.
When to use it
Questions
How does it decide a line was changed rather than deleted and re-added?
It does not, exactly — the line diff only produces added, removed and unchanged rows. When a removed row is directly followed by an added row, the tool treats that as a changed line and runs a word-level diff over the pair, showing both rows with the differing words highlighted. A deletion and an insertion that are not adjacent stay separate.
What does 'Ignore whitespace' actually compare?
For the equality test it collapses every run of whitespace in a line to a single space and trims the ends, so ' foo( a, b )' and 'foo( a, b )' match. The rows still show your original text unchanged; only the matching is affected.
Is this a merge tool?
No. It shows the difference between two blocks but never combines them, and it has no three-way mode, no base revision and no conflict resolution. Use it to understand a change, then apply the edit yourself or in your editor or version-control tool.
Why did a large paste show nothing?
The line diff builds an n-by-m table, so there are two hard caps: the two inputs together may not exceed 200,000 characters, and the line counts multiplied together may not exceed about four million. Past either one the tool stops and tells you instead of locking up the tab. Diff a smaller section at a time.
What does 'Ignore whitespace' actually change?
The matching rule, not the display: lines are compared after runs of whitespace collapse to one space and both ends trim, so a re-indented or re-wrapped line still counts as unchanged. The rows still show your original text exactly as pasted — the softening lives in the comparison only. It is the option for when one side passed through an editor that reformatted indentation.
Why does a large paste stop with a message?
Two caps guard an algorithm that builds an n-by-m table over the lines: 200,000 characters combined across both inputs, and about four million table cells from the line counts. Either cap halts the comparison with a clear error instead of freezing the tab. Prose and config files sit far inside both; minified JavaScript — thousands of characters on one line — is the shape that hits the first cap, so pretty-print before diffing it.
Why does one changed word mark the whole line?
Line granularity is the diff's first pass: a line is same, added or removed as a unit. Where a removed line sits directly above an added one, the word-level pass runs over that pair and highlights which words actually moved. If the surrounding context does not line the pair up, the coarse line-level result stays — an accurate statement ('one line replaced another') even where it is not the finest-grained one.
Can it compare Word, PDF or HTML documents?
Not directly — it compares the text you paste, and pasted documents bring extractor artifacts: soft line breaks at odd widths, ligatures, curly quotes that differ from straight ones. Export both sides to plain text through the same path, then compare; a diff over differently-extracted sources reports the extractors as much as your edits. For HTML specifically, the HTML-to-Markdown tool gives a cleaner comparison medium than raw markup.
Does it detect text that moved between blocks?
No — a moved block reads as a removal in one place and an addition in another, because the engine tracks same, added and removed only. Move detection is heuristic territory where plausible-looking guesses are easy and wrong; this tool stays with the deterministic core that is exactly correct and leaves interpreting the move to you.
How exact is the character matching?
Strict, with no Unicode normalization applied: 'café' written composed and the same word with a separate combining accent are different strings and show as changed. That strictness is exactly right for code and data, where a hidden composed-versus-decomposed pair is a real bug this diff will find; for comparing prose where you suspect only the encoding differs, normalize first, then diff.