Text Diff & Compare

Global tools

Paste two versions of anything - a paragraph before and after an edit, a config file, a contract, a list of names - and this page shows what changed between them: line by line by default, or word by word, as a unified diff you can copy and as a table of changes with the words that actually moved inside each rewritten line. Both texts stay in the browser, and the comparison is redrawn on every keystroke.

Everything happens in this tab as you type. Leaving this box empty is allowed: the answer is then a text that was entirely added.

Two empty boxes are the one input this page refuses, because every answer it could print would be an empty diff.

Line by line is what a review reads, and it is the format the diff download is written in. Word by word marks the changes inside the sentence instead, which is what a paragraph edit needs.

`Price` and `price` are the same line to somebody reading prose and different lines to somebody comparing a config file, so this is a switch rather than a decision made for you.

Ignoring whitespace collapses every run of spaces and tabs to a single space before the comparison. The text that is printed is still exactly what you pasted.

Two texts that differ only in how they are spaced out are the commonest false alarm there is. Ignoring blank lines drops them from both sides, so the line numbers become the numbers of the lines that are left.

How many unchanged lines the diff prints on either side of a change. Three is what `git diff` uses; zero prints nothing but the changes themselves.

Leave it blank for "text-diff.txt" and "text-diff-changes.csv".

Results update as you type. Nothing leaves your device.

Currency symbol

Symbol only - nothing is converted and no exchange rate is used. Figures quoted in the explanation text stay as the sources publish them.

Changes to read

4

3 lines added, 3 removed and 2 rewritten, in 2 hunks. The two texts are 25% the same.

Identical
25% shared units over the units in both texts
Unchanged
1 units in both texts, in the same order
Added
3 only in the second text
Removed
3 only in the first text
Rewritten
2 a removal paired with an addition
First / second
4 / 4 25 and 24 words

The two texts, line by line

The first textThe second text
-Shipping is free on orders over $50.
+Shipping is free on orders over $75.
-Orders are sent within two working days.
+Orders are sent within one working day.
-Returns are accepted for 30 days.
Custom items cannot be returned.Custom items cannot be returned.
+Gift cards are not refundable.
All 7 units, in order.
A blank line is a row like any other, which is why one blank line added in the middle shows up as a change.

A `-` is a unit only the first text has, a `+` is a unit only the second has, and an empty mark means the unit is in both. A rewritten line appears twice here, once on each side, which is exactly what a review needs to see.

What changed, one row per change

ChangeWhereThe first textThe second textWords goneWords arrived
changedline 1 into line 1Shipping is free on orders over $50.Shipping is free on orders over $75.5075
changedline 2 into line 2Orders are sent within two working days.Orders are sent within one working day.two daysone day
removedline 3Returns are accepted for 30 days.Returns are accepted for 30 days
addedline 4Gift cards are not refundable.Gift cards are not refundable
All 4 changes.
Compared line by line, with every difference counting.

`Words gone` and `Words arrived` are a set difference rather than an alignment: they answer "which words moved in or out of this line" without pretending to know which word replaced which. A word that only changed case counts as gone and arrived, unless case is being ignored.

The diff, unified

--- the first text
+++ the second text
@@ -1,4 +1,4 @@
-Shipping is free on orders over $50.
+Shipping is free on orders over $75.
-Orders are sent within two working days.
+Orders are sent within one working day.
-Returns are accepted for 30 days.
 Custom items cannot be returned.
+Gift cards are not refundable.

Copy it, or download it. `-` is a line only the first text has, `+` is a line only the second has, a space is context, and the numbers in the `@@` headers are the line numbers of the two texts you pasted. It reads like a patch but it is not one: a patch needs the exact bytes of the original file.

What the numbers do not say

  • The algorithm is patience diff: the units that appear exactly once on each side are found first, the longest run of them that is in the same order on both sides becomes the anchors, and the gaps between the anchors are compared the same way. It is the algorithm `git diff --patience` uses, and it is why a rewritten line in the middle of a document comes back as one changed line rather than as a wall of changes.
  • The decision nobody else states: when a stretch of both texts holds no unit that appears exactly once on each side, there is nothing to line the two sides up with, so this page pairs the units by position and reports the whole stretch as replacements rather than guessing which line became which. A repeated line - a lone `}` or a blank line, both of them common - is deliberately not an anchor for the same reason: it appears more than once, so it says nothing about where the two texts line up.
  • A moved line is reported as a removal and an addition, not as a move. Detecting moves is a different algorithm with its own surprises, and a page that claimed to have found a move it could not prove would be worse than one that shows the two halves honestly.
  • Similarity is 25% here, and it is the shared units as a share of the units in both texts - the Dice coefficient, so 100% means identical and 50% means half of what either text has is shared. The comparison is over 4 and 4 units: a text with a paragraph added is not "90% similar", it is a text with a paragraph added, and the counts beside the percentage are the numbers to read.
  • What is not here, on purpose: no three-way merge, no conflict resolution, no syntax highlighting and no "accept this change" buttons - those belong to an editor with a file to write back to, and this page never touches a file. The two downloads are the diff itself and the change list, and neither is a patch that would apply cleanly, because a patch needs the exact bytes of the original file rather than the text of a box.
Compared in this tab by the same function that produced the diff already in the page you loaded, so nothing was sent anywhere - and there is no endpoint behind this page that could accept two documents even if something tried to send them. A contract under negotiation can be pasted here.

A diff looks simple and is not, which is why two tools can disagree about the same pair of texts. This page makes the three decisions out loud: what a unit is (a line or a word), when two units count as the same (case and spacing are switches, not assumptions), and how two sides are lined up when they do not line up. The third one is the decision nobody else explains, and it is answered here rather than hidden.

About this text diff & compare

Spotting a change between two drafts sounds like a solved problem, yet two diff tools routinely disagree about the same pair of texts. This page shows what moved - line by line or word by word, as a unified diff you can copy and as a change table naming the words inside each rewritten line - and redraws the comparison on every keystroke.

The disagreements come from three decisions, and this page makes all three out loud: what a unit is, when two units count as the same, and how two sides are lined up when they do not line up. The first two are switches for case and spacing; the third is the alignment rule most tools hide, and it is written out here rather than buried in the output.

The answer is a comparison, not a merge: this page tells you what changed and never writes the combined file for you. Both texts stay in the browser and the whole thing runs client-side, so a contract, a config or a private note can be compared without either version being sent to a server to be diffed.

How this text diff & compare works

What a diff actually decides

The hard part of a diff is not spotting a changed line: it is knowing which line in the first text corresponds to which line in the second, because a document that had a paragraph inserted near the top is not a document in which everything after it changed. A diff that pairs badly shows a hundred changed lines where a human sees an insertion.

This page compares with **patience diff**, the algorithm `git diff --patience` uses. It looks for the units that appear exactly once on each side - a line that occurs once in both texts is almost always the same line - takes the longest run of those that is in the same order on both sides, and uses them as anchors. Everything between two anchors is compared again by the same rule, recursively.

The decision nobody explains, and what this page does about it

Sooner or later there is a stretch of both texts with no anchor in it at all: nothing in there appears exactly once on each side, so nothing says how the two sides line up. Every diff tool has to do something here, and most of them do not say what. This one pairs the units by position and reports the whole stretch as replacements, which is honest and predictable: if you delete two lines and write two different ones, you get two rewrites rather than a guess about which line became which.

The same rule is why a repeated line is not an anchor: a lone closing brace, an empty line, a list of identical table rows - each appears more than once, so a match on one of them says nothing about where the two texts really line up. And a line that moved is reported as a removal and an addition rather than as a move, because detecting moves is a different algorithm with its own surprises and a page that claims a move it cannot prove is worse than one that shows both halves.

Two ways to read the same answer

Line by line gives you the format a review reads: `-` for a line only the first text has, `+` for a line only the second has, a space for the context around a change, and a `@@ -12,7 +12,8 @@` header naming the lines in each text that the hunk covers. That is what the diff download contains, and it is what you paste into a ticket or a chat.

Word by word prints the text **once** with the change marked inside it - `shipping is free over [-$50.-]{+$75.+}` - which is what a paragraph edit needs, because reading a unified diff of two long sentences means noticing one word in two lines. A unit there is a run of non-whitespace characters or a run of whitespace, so punctuation travels with the word it is attached to and the marking never invents a word boundary.

What the switches do, and what they do not

Case and spacing are switches because both answers are right for somebody: `Price` and `price` are the same line to a reader and different lines to a configuration file, and two spaces where one was is a change to a reader of code and noise to a reader of prose. Ignoring either one changes only what counts as a difference; the text printed on the page is always exactly what was pasted, so you can check the switch rather than trust it.

Ignoring blank lines is the switch that kills the commonest false alarm - two texts that differ only in how they are spaced out - and it is the one switch with a stated cost: the blank lines are dropped from both sides, so the line numbers in the tables become the numbers of the lines that are left. The context setting decides how many unchanged lines the diff prints around each change, which is what `git diff -U` does.

Worked examples

Each example below was run through the calculator on this page when the site was built, so the numbers match what you see when you enter the same inputs.

One word changed in a sentence

The first text (the original): Shipping is free on orders over $50. · The second text (the changed one): Shipping is free on orders over $75. · Compare: Word by word (what a paragraph edit reads)

Changes to read

1

1 word added, 1 removed and 1 rewritten, in 1 hunk. The two texts are 92.3% the same.

Identical: 92.3% · Unchanged: 12 · Added: 1 · Removed: 1

The word mode marks the change inside the sentence: reading the same edit as a unified diff means noticing one word in two lines that look almost identical.

A paragraph inserted, and nothing else called a change

The first text (the original): The first line. The last line. · The second text (the changed one): The first line. A new line in the middle. The last line.

Changes to read

1

1 line added, 0 removed and 0 rewritten, in 1 hunk. The two texts are 80% the same.

Identical: 80% · Unchanged: 2 · Added: 1 · Removed: 0

The two lines that survived are anchors, so the answer is one addition rather than three changed lines - which is exactly what a badly paired diff would print.

The same text, spaced out differently

The first text (the original): alpha alpha bravo · The second text (the changed one): alpha alpha bravo · Blank lines: Ignore them: blank lines are dropped from both sides

No differences

0

The two texts are the same line by line, ignoring blank lines. Every unit of both texts is a unit of the other, in the same order.

Identical: 100% · Unchanged: 3 · Added: 0 · Removed: 0

With blank lines ignored there is nothing to report, which is the honest answer to the commonest false alarm there is.

Everything on one side is new

The first text (the original): — · The second text (the changed one): A first line. A second line.

Changes to read

2

2 lines added, 0 removed and 0 rewritten, in 1 hunk. The two texts are 0% the same.

Identical: 0% · Unchanged: 0 · Added: 2 · Removed: 0

One box empty and one box full is allowed, and it is answered as a text that was entirely added: two additions and nothing else.

Frequently asked questions

Is anything I paste sent anywhere?

No. The comparison follows one fixed rule applied to two strings: it runs in your browser as you type, and the same rule ran when the page was prepared, so the diff is already inside the page you loaded. There is no upload button because there is no upload, and there is no endpoint behind this page that could accept two documents even if something tried to send them. A contract under negotiation can be pasted here.

Why does a moved paragraph show as a removal and an addition?

Because that is what the algorithm can prove. Detecting a move means finding a run of lines that appears in both texts at a different place, which is a different algorithm with its own failure modes, and most tools that claim to detect moves do so with a similarity threshold that is a guess. This page shows the two halves honestly and says so; the move view is a feature of an editor that has the file.

Why is my two-line change reported as four changes?

Check the blank-line and whitespace switches, and read the side-by-side table: if the lines that look identical differ in trailing spaces, in tabs versus spaces, or in case, they are different lines under the current settings. Every rewritten line also names the words that left and arrived, which is usually enough to see which invisible character is being counted. If it is a spacing difference you do not care about, the whitespace switch is the answer.

Is the diff a patch I can apply?

No, and the page says so. It is a unified diff in the sense a reader recognizes: the `-`, the `+`, the context and the `@@ -start,count +start,count @@` headers are all real. A patch that applies cleanly needs the exact bytes of the original file - its name, its line endings, its mode - and this page has two boxes of pasted text rather than a file, so calling the download a patch would be a lie the first time something pasted out of a web page had its line endings normalized.

How is the similarity percentage worked out?

It is the shared units as a share of the units in both texts: the Dice coefficient, `2 x shared / (first + second)`. Identical texts are 100%, two entirely different texts are 0%, and adding one paragraph to a long document moves the number by a couple of points because of arithmetic rather than because the document became more different. That is why the counts are printed beside it: the percentage is a summary and the counts are the answer.

What counts as a unit in word mode?

A run of non-whitespace characters, or a run of whitespace. So `$50.` is one unit including its full stop, an apostrophe stays inside the word it belongs to, and a curly quote pasted out of a word processor travels with the word it is attached to. The marking is honest at that granularity: it shows which character runs changed, and it does not try to decide what a word is in a language it has not detected.

Can it compare more than two texts?

Not on this page. A three-way merge is a different tool with a different answer - it has to work out what each side changed relative to a common ancestor, and then what to do where both sides changed the same thing - and doing it badly is worse than not offering it. Compare two versions at a time here, and use the change list download when you need to talk about the differences afterwards.

Does it handle very long texts?

Yes, and the algorithm is chosen for that: patience diff cuts the common prefix and suffix first and then works through anchors, so a long document with a handful of edits is quick, and a document rewritten line by line costs more but stays proportional to the anchors rather than quadratic in the lines. The tables cap what they print - forty changes, sixty lines - and both downloads are always complete.

Assumptions and sources

  • The comparison is a line-by-line diff with git-style `@@` headers, plus an optional word-level view.
  • The switches change what counts as a difference, not what is printed: with case ignored, `Price: 10` and `price: 10` are one line.
  • There is no three-way merge and no advice on which version is better; both texts stay in your browser and are never uploaded.

Last reviewed 2026-09-17. Runs locally on your device; keep backups; no financial advice applies. Read the full disclaimer.

Where a figure on this page comes from an official agency — HUD, IRS, FICO or a state body — the site keeps a dated snapshot of the source page in its sources library, and a scheduled job re-checks that snapshot, so the number can be traced back to the document it came from.