Skip to main content

Text Diff – Find the Differences Between Two Texts Online

Compare two texts free online: character, word and line granularity, optional case and whitespace ignoring, additions and deletions highlighted with counts. All in your browser.

Runs on your device — nothing is uploaded

Original Text chars · words · lines
Modified Text chars · words · lines

Enter text in both panels above to see the difference

The two texts are identical

Original Text
Modified Text
Diff Result

Which clauses changed in a contract, how many edits the copy chief made, where two JSON payloads differ, whether two student submissions are copies of each other — "find what differs between two long texts" is an infrequent but critical task. Eyeball line-by-line comparison goes wrong at a rate that climbs steeply with length; a real diff algorithm misses nothing.

This tool does the classic segment-by-segment comparison: paste one text on each side, additions and deletions are highlighted in place, with change counts. Three granularities to choose from, instant recalculation on any parameter change. Everything happens in the browser — contracts, unpublished copy and the like never touch a server.

How to use

Paste one text on each side

Original on one side, modified on the other. Results appear as you paste and recalculate instantly when parameters change.

Choose the granularity

Line level (segments split at newlines), word level (tokenized at spaces, the default), character level (compared character by character) — which of the three fits which case, see the next section.

Ignore noise as needed

Turn on ignore case (A and a count as the same) or ignore whitespace (differences of spaces and indentation do not count as changes) — in proofreading these two switches filter out a mass of uninformative "differences".

Read the highlights and the counts

Deleted content is marked red, added content green, unchanged parts left as they are; the summary on top gives the added and deleted segment counts, the size of the change at a glance.

Three granularities: do not pick the wrong one

The same "cat changed to cap" yields three different answers under the three granularities — granularity decides the smallest unit of change:

Granularity Smallest unit Highlight result Fits
Line level A whole line Whole lines marked red and green Code, config files, line-organized lists
Word level A space-separated word Only cat→cap highlighted English prose, proofreading copy (default)
Character level A single character Only t→p highlighted Chinese and other unspaced texts, serial numbers, fine-tuning code snippets

Chinese users take special note: word level tokenizes at spaces, and for Chinese, which has none, it cuts a whole passage into one or two giant chunks — the differences blow up into "a wall of red and a wall of green" with no way to see which character changed. Use character level for Chinese; for English prose the reverse holds — character level turns "one word swapped" into a scatter of tiny differences inside two words, and word level is far cleaner.

A diff finds "the set of changes", not "who copied whom". It aligns the two texts and gives the minimal edit path — two unrelated texts still share plenty of "unchanged" parts (common words, formatting), and two highly similar texts may simply share a template. Judging similarity always needs a human to draw the conclusion.

Frequently asked questions

Is there a file size limit?

No hard limit, but the diff's cost scales with the product of the text lengths — two very long passages (several MB each) first choke on browser rendering. Everyday contracts, articles and code files (tens to hundreds of KB) return instantly.

Can I compare two files?

Copy and paste their contents first. This tool's input areas are text boxes — parsing file byte streams is the pipeline of file tools; text comparison starts from the semantics of "two passages of text".

What is a part marked both red and green?

That is a rewrite: the passage was deleted from the original and new content added in its place — the diff algorithm pairs adjacent deletions and additions and displays them together, to be read as "this changed from X to Y". Pure red is deletion only; pure green is addition only.

Why is my Chinese text entirely red under word level?

Word level tokenizes at spaces and Chinese has none — the whole passage becomes one "word", so any single change replaces the entire word. Switch to character level to pin it down to the character. That is why the granularity section calls it out separately.

With ignore whitespace on, do indentation changes still count?

No. A re-indented code block, an extra space in copy — such differences vanish once "ignore whitespace" is on; what remains are substantive changes. Recommended for proofreading and copy-comparison; turn it back off when checking typesetting.

Is the contract I pasted safe?

It never leaves the browser. Comparison, highlighting and counting all compute locally with zero network requests — which is the whole argument for using a local tool rather than a cloud service for sensitive text.