Text Diff Checker
Compare two texts and see exactly what changed — line by line or word by word.
- Free forever
- No sign-up
- Runs in your browser
Original
Changed
Differences
Both texts are compared locally in your browser. Nothing is uploaded.
What is a text diff checker?
A text diff checker takes two versions of the same text — an original and a changed copy — and shows you precisely what is different between them. Instead of squinting at two windows side by side and hunting for the one word that moved, you get every insertion and deletion highlighted in colour: green for what was added, red for what was removed, and plain text for everything that stayed the same.
This tool compares your text entirely in your browser. There is no upload, no account and no waiting on a server. You paste the original on the left, the changed version on the right, and the differences appear instantly underneath. Because the work happens on your own device, you can compare sensitive material — contracts, internal docs, API responses, source code — without it ever leaving your machine.
How to use it
- Paste the original text into the left box and the changed text into the right box. Click Sample if you want to see how the highlighting behaves first.
- Choose Line or Word mode at the top, depending on what you are comparing (more on that below).
- Read the result panel: green is added, red with a strike-through is removed, untouched text is shown plainly.
- Check the running counts of additions and removals to gauge how big the change is, or run either version through the word & character counter for full totals.
- Use Swap sides if you pasted them the wrong way round, Copy diff to grab a plain-text version with
+/-markers, or Clear to start over.
Line diff vs word diff: which to pick
The mode you choose changes how the comparison is sliced, and the right one depends on your text.
- Line diff treats each line as a single unit. If anything on a line changes, the whole line is marked removed and the new line marked added. This is ideal for code, configuration files, CSV rows, logs and lists — anywhere line breaks are meaningful and you care about which lines moved.
- Word diff breaks the text into words and compares those. A single edited word inside a long paragraph is highlighted on its own, leaving the rest of the sentence untouched. This is far better for prose, articles, emails and contracts, where a line diff would flag an entire paragraph as changed just because one word was swapped.
A good rule of thumb: if you write the text for a machine, use line diff; if you write it for a human, use word diff. When a result looks noisy, try the other mode — the same change often reads much more clearly one way than the other.
How diffs actually work
Under the hood, a diff is the answer to a precise question: what is the smallest set of insertions and deletions that turns the original into the changed version? Algorithmically this is built on the longest common subsequence (LCS) — the longest sequence of lines (or words) that appears in both texts in the same order. Everything in the LCS is "unchanged"; everything in the original that is not in the LCS is a removal; everything in the changed text that is not in the LCS is an addition.
This is why a diff sometimes surprises you. It does not understand intent — it only minimises edits. If you cut a paragraph from the top of a document and paste it at the bottom, the algorithm has no concept of "move"; it sees a deletion in one place and an addition in another. Knowing this makes diffs easier to read: a paired red-then-green block usually means replaced, and a lone green block at the end usually means appended.
Common use cases
- Code review. Before committing, paste the old and new versions of a function to confirm you only changed what you meant to — no stray edits, no accidental deletions. Line mode mirrors how version control shows changes.
- Contract and document revisions. Compare two drafts of an agreement to spot every altered clause. Word mode shines here: a single changed figure or date stands out instead of being buried in a "changed paragraph".
- Content editing. Writers and editors can see exactly what a round of edits touched — useful for tracking changes when a document is passed back and forth without built-in revision history.
- Configuration and data troubleshooting. When something works on one environment and breaks on another, diffing the two config files or two API responses often reveals the one differing value behind the bug.
- Catching copy-paste errors. Comparing a value you typed against the source it came from quickly surfaces a transposed character or a missing line.
Tips for cleaner diffs
- Normalise before comparing. Stray trailing spaces or mixed line endings can show up as differences that are not really meaningful. If you only care about content, trim the text first — and stripping repeats with remove duplicate lines can cut the noise before you compare.
- Match the granularity to the change. For a one-word tweak in a long document, word mode keeps the result readable; for a structural change across many lines, line mode keeps it organised.
- Read paired blocks as replacements. A red block immediately followed by a green block is almost always the same content being rewritten, not two unrelated edits.
- Compare in chunks. Two completely different texts produce an overwhelming wall of colour. Diffs are most useful when the two versions are mostly the same and you are looking for the handful of real changes.
Private by design
Many popular diff tools run the comparison on their servers and store your pasted text in a session you can share by URL — convenient, but it means your text now lives on someone else's machine. In November 2025 a widely used server-side text formatter leaked pasted secrets through its saved-session feature, a reminder that "paste it into a website" can quietly become "upload it to a company". This tool takes the opposite approach: the diff runs locally, nothing is transmitted, nothing is retained, and closing the tab erases everything. Compare what you need, copy the result, and move on with confidence that your text stayed yours.
Frequently asked questions
Comet's got your back
Stuck on something? Every tool has a short guide and FAQ — and Comet can point you to the right spot.
Visit help centreRelated tools
All Developer tools →Remove Duplicate Lines
Delete duplicate lines from any list or text, with trim, case and sort options — instantly in your browser.
Text & WritingJSON Formatter
Format, beautify and minify JSON with instant validation — all in your browser.
DeveloperBase64 Encoder / Decoder
Encode text to Base64 or decode it back — instantly and privately in your browser.
Developer