Text Diff Checker

Compare two versions of any text and see the difference at a glance — lines that were added glow green, lines that were removed glow red, and everything unchanged stays plain.

1Paste the original text on the left
2Paste the new text on the right
3Compare and read the highlighted result

Private by design: 100% in your browser — nothing is uploaded, no sign-up. This tool runs entirely on your device.

How to use this diff checker

Paste the earlier version of your text into the left box and the later version into the right box, then press “Compare texts”. The result lists the lines of both documents woven together in order: unchanged lines in plain white, lines that exist only in the original shown in red with a minus sign, and lines that exist only in the new version shown in green with a plus sign. A summary above the result counts each kind, so a one-line change in a nine-hundred-line file announces itself before you scroll anywhere.

Under the hood the checker finds the longest run of lines the two texts share, in the same order, and treats that as the backbone of the document. Everything off the backbone is a change. This is the same principle that powers the diff view in version-control systems, and it is why the output stays minimal and sensible: a paragraph inserted in the middle shows as exactly that insertion, not as a cascade of false changes running to the end of the file. If one document is a re-indented copy of the other, tick “Ignore leading/trailing whitespace” so spacing-only differences stop masquerading as edits.

The Swap button exchanges the two boxes and re-runs the comparison — useful when you pasted new-before-old and want the report to read as a journey from the original to the revision, with additions and removals the right way round.

Example: one word, honestly reported

The pre-filled texts are the classic pangram with a single word changed:

The quick brown fox jumps over the lazy dog

against the same text with “jumps” replaced by “leaps”. The comparison reports:

The quick brown fox − jumps over + leaps over the lazy dog

One line removed, one line added, two lines unchanged. Because the comparison is line-based, a one-word edit shows as a whole line leaving and arriving — a deliberate trade: the result stays simple enough to read at a glance, and for prose and configuration files, where lines are short, it is exactly the right granularity.

What people actually compare

The everyday uses are more varied than code review. A writer compares the draft they sent with the draft that came back from an editor, to see precisely what changed without re-reading both. A system administrator diffs yesterday's configuration file against today's to find which setting a colleague touched. A student checks that the “final” essay really only fixed the paragraph they meant to fix. A careful shopper compares two versions of a contract or a terms page. In every case the question is the same — what, exactly, is different between these two texts — and it is a question the human eye answers badly, because sameness is invisible and the one changed line hides among hundreds of identical ones. The highlight colours do the finding for you.

Reading a diff like a reviewer

A few habits make diffs more informative. Read removals and additions as pairs: a red line immediately followed by a green line is almost always an edit, while a block of green alone is an insertion and a block of red alone is a deletion. Watch the counts before the content — a change you expected to be small that reports forty altered lines is telling you something went wrong upstream, perhaps a line-ending conversion or a reformat, before you read a single line. And when a diff looks noisy everywhere, suspect the invisible: trailing spaces, tabs converted to spaces, or Windows line endings in one file and Unix in the other. This checker normalises line endings automatically and offers the whitespace toggle for the rest, so the noise you see is the noise that is really there.

Frequently asked questions

How does the diff decide what changed?

It finds the longest sequence of lines the two texts share in the same order (the longest common subsequence), then reports everything outside that shared backbone: lines only in the first text as removed, lines only in the second as added. That produces the smallest, most natural set of changes — the same approach version-control tools use.

Why is an edited line shown as one removal plus one addition?

Because this checker compares whole lines, not words. If a single word changes, the old line leaves and the new line arrives, shown as a red line followed by a green one. That keeps the result honest and readable; a word-level diff of long lines is available in most code editors when you need finer detail.

What does “ignore whitespace” change?

With it ticked, lines that differ only in leading or trailing spaces are treated as the same line. That is the right choice when one text was reformatted or re-indented and you care about content changes only. Leave it unticked when exact spacing matters, such as in code or configuration files.

Are my texts uploaded anywhere?

No. The comparison runs in JavaScript in your browser. Drafts, contracts, config files and code you compare here are never sent to a server, stored or logged — and the tool works offline once the page has loaded.

Can I compare code with this tool?

Yes — code is just lines of text, and line-by-line comparison is exactly what developers do when reviewing a change without a repository. It works for configuration files, JSON and XML documents, SQL, and plain prose alike. Syntax highlighting is not applied; the green and red lines carry the meaning.

What do the counts at the top mean?

Added counts lines present only in the second text, removed counts lines present only in the first, and unchanged counts lines in both, in the shared backbone. A changed line contributes one to added and one to removed. If added and removed are both zero, the texts are identical line by line.

Does line order matter?

Yes. A diff is about sequence, not just content: moving a paragraph to a different place shows as a removal at the old position and an addition at the new one, even though no words changed. If you only need to know whether two files contain the same lines in any order, sort both with the Sort Lines tool first, then compare.

How large can the texts be?

A few thousand lines on each side compare instantly. The comparison work grows with the product of the two line counts, so two documents of tens of thousands of lines can take a noticeable moment — still fine on a typical machine, but worth knowing before pasting a whole log file.

What is the Swap button for?

It exchanges the two texts and re-runs the comparison, flipping the perspective: what was “added” becomes “removed” and vice versa. It is handy when you pasted the newer text on the left by habit and want the report to read as changes from old to new.

Related tools