Text diff checker — compare two texts
Compare two texts and see exactly what changed, line by line and word by word, side by side or as a downloadable unified diff.
- Runs in your browser
- Files are never uploaded
- Free, no account
Indentation and repeated spaces are not treated as changes.
“Total” and “total” count as the same line.
Keep 3 lines of context around each change.
How to compare two texts
- Put the older or original version in the left box and the newer version in the right box. Files can be dropped straight onto either box.
- The comparison runs automatically. Removed lines are tinted and marked with a minus, added lines with a plus, and edited lines show the changed words highlighted inside them.
- Turn on Ignore whitespace when only the indentation or wrapping has changed, and Ignore case when capitalisation is not meaningful.
- Switch between side-by-side and unified views. Unified is easier on a phone and matches what you see in a code review.
- Copy or download the unified diff to attach to a ticket, an email or a pull request.
How the diff is calculated
The comparison uses Eugene Myers’ 1986 O(ND) greedy algorithm — the same approach behind
git diff and GNU diff. It finds the shortest edit script: the smallest set of
insertions and deletions that turns the first text into the second. That is what makes the
output feel “right”: a moved paragraph shows as one deletion and one insertion rather than a
cascade of unrelated changes.
Pure Myers slows down when two large files share very little, so before it runs, the tool trims the identical prefix and suffix and then splits the remaining work on patience anchors — lines that appear exactly once in both texts, such as a unique heading or function signature. Each gap between anchors is small enough for Myers to solve instantly, and the anchors themselves keep the alignment sensible in files with lots of repeated boilerplate.
Once lines are aligned, each pair of a deleted and an inserted line is diffed again at word level using the same algorithm on tokens, which is what produces the inline highlighting.
Reading the change summary
| Figure | What it means |
|---|---|
| Added | Lines that exist only in the new text |
| Removed | Lines that exist only in the original |
| Modified | Lines that were edited in place — a removal and an insertion the tool paired up |
| Unchanged | Lines identical in both, under your current comparison options |
| Similarity | Unchanged lines as a percentage of the longer document |
What people use it for
- Contract review — spot the clause that changed between two supplier drafts, without asking for a tracked-changes copy.
- Editing — see precisely what an editor altered in a manuscript or a press release.
- Configuration debugging — compare a working config with a broken one when “nothing changed”.
- Translation and localisation — check which strings moved between two export files.
- Academic integrity and plagiarism spot-checks — measure how much two submissions overlap.
- Code review offline — paste two versions of a function and read the diff without a repository.
Unified diff format
The downloadable file is a standard unified patch. Each hunk starts with a header such as
@@ -12,7 +12,9 @@, meaning “seven lines starting at line 12 of the original
became nine lines starting at line 12 of the new file”. Context lines start with a space,
removals with - and additions with +. Three lines of context are
included around each change, and nearby changes are merged into one hunk. Tools such as
git apply, patch and most review platforms accept it directly.
Privacy and size limits
Both texts stay in your browser: there is no upload step, so comparing a confidential contract or an unreleased document is safe. Files of a few megabytes are handled comfortably. Above roughly 6,000 changed lines the word-level highlighting is skipped so the page stays responsive, and the on-screen table is capped at 1,200 rows — the downloadable diff always contains every change.
Questions
Which diff algorithm is used?
Myers' O(ND) greedy algorithm — the same family used by git — with a patience-style pass that anchors on lines appearing exactly once in both texts. That keeps large, heavily edited files fast while still producing a minimal edit script.
Can I compare files instead of pasting?
Yes. Drop a .txt, .md, .csv or code file onto either box, or use the Open file button. The file is read by your browser and never uploaded.
What does "ignore whitespace" actually ignore?
It collapses runs of spaces and tabs to one space and trims each line before comparing, so re-indented code or re-wrapped prose stops showing as a change. The output still shows the original text.
Can I use the result in git?
Yes. "Download .diff" produces a standard unified patch with @@ hunk headers and three lines of context, which git apply and most review tools accept.
How large a file can it handle?
Comfortably a few megabytes. Above roughly 6,000 changed lines the word-level highlighting is skipped to keep the page responsive, and the on-screen table is capped — the downloadable diff always contains everything.