Text Diff Checker
Paste two versions and see exactly what changed, down to the word.
Word level reads better in prose. Character level catches a single typo.
- Lines added
- 0
- Lines removed
- 0
- Lines changed
- 0
- Unchanged
- 0
Paste text into both boxes and the differences appear here.
These two texts are identical under the current options.
| Original line number | Original | Changed line number | Changed |
|---|
Unified patch
The same change written in the format git apply, code review tools and
patch already read.
Everything here runs on your device. Nothing you enter is uploaded or stored.
Paste two versions of anything and see exactly what changed. Lines are aligned first, then every changed line is compared again inside itself at word or character level, so a single altered word is highlighted as a single word rather than as two entirely rewritten lines. Nothing is uploaded.
How to use it
- Paste the original into the left box and the new version into the right.
- The comparison runs as you type. You can also edit either side directly.
- Pick word or character for the level of detail inside each changed line.
- Switch between side by side and inline — the same comparison, two ways of reading it.
- Turn on ignore whitespace or ignore case if reformatting is drowning out the real changes.
- Copy the unified patch at the bottom if you need to hand the change to
git applyor paste it into a code review.
Why a diff has to run twice
Most comparison tools pick one level and stay there, and both choices are wrong on their own.
Compare line by line only, and you learn that line 40 changed but not what changed in it — you re-read the whole line and find the difference yourself, which is the work you came here to avoid. Compare word by word across the entire document instead, and the line structure disappears: the output becomes one long ribbon of insertions and deletions with no way to see which paragraph you are in.
So this tool does both, in order. The first pass aligns lines using Myers’ shortest-edit-script algorithm — the same algorithm git diff uses — which finds the smallest set of insertions and deletions that turns one side into the other. The second pass takes each line that changed and diffs it against its counterpart, at word or character level, producing the highlighting inside the row.
Between those two passes there is a third step that matters more than it sounds: a deleted line and an inserted line that are similar enough get paired into one changed row. Without it, fixing one word in a paragraph renders as a removed block followed by an added block, and you are back to aligning them by eye. The pairing is gated on similarity, so replacing a paragraph with a genuinely different one still shows as a removal and an addition — which is what it is.
What it does not do
It does not detect moved blocks. A paragraph relocated from the top of a document to the bottom shows as a deletion and an addition, not as a move, because move detection needs a second matching pass that guesses at intent. It does not diff structure — two JSON files with the same data in a different key order are, to this tool, different text. It has no three-way merge and no conflict resolution: this compares two texts and shows you the difference, it does not combine them. And it will not tell you which version is correct.
Everything here runs in your browser. No text is uploaded, logged, or stored, which is the point when you are comparing a contract or a draft nobody has seen.
Which level to use
| Situation | Level | Why |
|---|---|---|
| Edited prose or copy | Word | Whole-word highlights are faster to read than letter-level ones |
| A changed digit in an ID or price | Character | The one wrong character is the whole finding |
| Reformatted code | Word, ignore whitespace | Indentation changes stop competing with real edits |
| Two exports of the same list | Word, ignore case | Case-only differences are usually an artefact of the export |
| A URL or a hash | Character | One transposed character is invisible at word level |
Questions
What is the difference between word level and character level?
Word level marks whole words as changed, which is what you want for prose — reading a highlighted word is faster than reading four highlighted letters inside it. Character level narrows the highlight to the exact characters, which is what you want when one digit in a long ID or one letter in a URL is wrong.
Why does one changed word show as a single changed line rather than a deletion and an addition?
Because the two lines are recognisably the same line edited. When a deleted line and an inserted line are similar enough, they are paired into one changed row and diffed against each other. Below that similarity threshold they stay separate, since a genuine block replacement is not an edit.
Does ignore whitespace mean whitespace is deleted?
No — runs of whitespace are collapsed to one space for the comparison. That distinction matters, because two spaces instead of one is noise, but two words joined into one is a real difference, and stripping whitespace entirely would hide the second case.
Is there a size limit?
No hard limit, but the comparison gets slower as the two texts become more unlike each other rather than as they get longer. Two versions of a long file compare almost instantly. Two completely unrelated long documents hit an internal budget, and the tool then compares lines by position and says so.
Is my text uploaded anywhere?
No. The whole comparison runs in your browser in plain JavaScript. Nothing is sent to a server, which matters when the thing you are comparing is a contract, a private draft, or unreleased code.
Last updated