Diff / Text Compare
Compare two blocks of text and see exactly what changed.
What you paste
Parsed in your browser — never uploadedHow this reads your output
The comparison uses a longest common subsequence, which is the same approach version control uses and the reason the output stays readable. A naive line-by-line comparison reports everything after an inserted line as changed; this identifies the largest set of lines common to both and marks only genuine additions and removals. Long runs of unchanged lines are collapsed so the differences stay visible.
What the results mean
- Added and removed
- Lines present in only one version. A modified line appears as one of each, since line comparison has no concept of an edit.
- Unchanged
- Lines common to both, in order. Runs longer than a couple of lines are collapsed in the output.
- Whitespace-only changes
- Blank lines added or removed. Often noise from an editor rather than a real change.
Common problems and fixes
- Two files that look identical report as different
- Trailing whitespace or line endings. A file saved on Windows ends every line with an extra carriage return that no editor displays, so every single line differs. Configure your editor to show whitespace, or normalise line endings before comparing.
- A moved block shows as a large change
- That is inherent to line-based comparison: a block moved elsewhere is a removal in one place and an addition in another, since nothing tracks identity across positions. Some version control tools detect moves with extra analysis, and even those get it wrong when the block was also edited.
Frequently asked questions
Why does one inserted line not shift everything after it?
Because of the longest common subsequence. It finds the largest set of lines appearing in both versions in the same order, so a single insertion is reported as exactly that. Without it, everything below an insertion would report as changed, which is why naive comparisons are unusable on real files.
Can it compare within a line?
Not here. Character-level comparison inside a changed line is useful for prose and noisy for code, where a small change often has large structural meaning. For prose, comparing sentence by sentence usually reads better than either.
Is there a size limit?
A practical one. The algorithm needs a table proportional to the product of both line counts, so very large inputs fall back to a simpler positional comparison rather than exhausting memory. For files that large, a local diff tool is the right choice.
Put this on your own site
Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.
<iframe src="https://runthetests.com/embed/diff-checker/" width="100%" height="720" style="border:1px solid #e5e5e5;border-radius:8px" title="Diff / Text Compare" loading="lazy"></iframe>
Preview it at https://runthetests.com/embed/diff-checker/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.