Text Diff Checker

Compare two versions of a text and see every line that was added, removed or rewritten.

Differences

Paste two versions above to compare them.

What a text diff actually shows you

A diff does not tell you what changed. It tells you the shortest set of edits that turns one text into the other — which is usually the same thing, and occasionally is not. Knowing the difference is what separates reading a diff from trusting it.

How the comparison works

The algorithm looks for the longest common subsequence of lines: the longest list of lines that appears, in the same order, in both texts. Everything in that list is marked unchanged. Everything else is an insertion or a deletion, and a line that appears as a deletion immediately followed by an insertion is what we display as a rewrite.

Worked example. The original is two lines — The report is due on Friday. and Send it to the team. — and the new version changes only the first, to The report is due on Monday.

The common subsequence is the second line. The first line is one deletion plus one insertion — and because they are adjacent, the word-level pass runs on that pair and highlights only FridayMonday instead of repainting the whole sentence.

Why a diff sometimes looks wrong

There is no single correct diff, only a shortest one, and ties get broken arbitrarily. Two cases account for almost every "that's not what I changed":

  • Moved blocks read as delete + add. Move a paragraph from the top of a document to the bottom and a line-based diff reports the whole paragraph twice: removed up there, added down here. Nothing was rewritten, but nothing in the algorithm knows that.
  • A repeated line matches the wrong occurrence. In a list where several lines are identical, the algorithm may pair your new line with the first identical one it finds and mark a different one as deleted. The result is correct — it produces the same output text — but it can be attributed to the wrong place.

Options that change the answer

  • Ignore case compares Total and total as the same line. Useful for prose, dangerous for code and for anything case-sensitive downstream.
  • Ignore whitespace collapses runs of spaces and tabs and trims the ends of lines. This is the option that turns an unreadable diff into a readable one after a reformat — and the option that hides a genuine indentation bug in a Python file or a YAML block.

Both options apply to comparison only: the text shown is always exactly what you pasted.

When to reach for it

Contract redlines where the other side sent a "clean" copy. Two exports of the same dataset that should be identical. A machine-translated page against its human-reviewed version. A prompt you edited twenty times and a colleague's version of it. Any case where the question is not "what does this say" but "what is different from what I already read".

FAQ - Frequently Asked Questions

Is my text uploaded anywhere?
No. The comparison runs in your browser as plain JavaScript — nothing is sent to a server, stored or logged. That matters for this tool more than most: people paste contracts, patient letters and unreleased code into diff checkers, and many online ones do upload what you paste.
Why does it show a whole paragraph as changed when I only moved it?
Because a line-based diff has no concept of a move. Moving text out of one place and into another is, from the algorithm's point of view, exactly a deletion plus an insertion, and it reports both. If the two copies are far apart, compare the sections separately to confirm nothing was altered in transit.
What is the similarity percentage?
The share of lines that came out unchanged, out of all the lines involved in the comparison. It is a rough shape indicator, not a plagiarism score: one edited word makes a whole line count as changed, so a text rewritten lightly throughout can score lower than one where a single large block was replaced.
Can I compare Word documents or PDFs?
Not directly — this tool compares text. Copy the text out of both documents and paste it in. Be aware that copying from a PDF often introduces line breaks at the end of every visual line, which makes two identical paragraphs look completely different; turning on "ignore whitespace" does not fix that, because the breaks are real characters. Pasting into a plain-text editor and re-joining the paragraphs first gives a usable comparison.
Does it work with Chinese, Japanese, Arabic or Hebrew?
Yes. The line comparison is script-independent, and right-to-left text keeps its own direction inside each row. The word-level highlight splits on spaces, so in Chinese, Japanese and Thai — written without spaces between words — a changed line is highlighted as a whole rather than word by word.
Is there a size limit?
The line-by-line alignment is capped at four million cell comparisons, which covers two documents of roughly 2,000 changed lines each. Beyond that the changed block is reported as fully replaced rather than aligned, so that the page stays responsive instead of freezing your browser tab. Unchanged text at the start and end is skipped before that limit applies, so two long, mostly-identical drafts compare fine.