Skip to content

Text Compare

Paste two versions of anything (a contract, an essay, code, a list) and see every difference as you type. A free diff checker that runs in your browser, so nothing you paste is uploaded.

v2026.10.11

6 lines differ

In 3 places. The texts are 80% alike.

  • 4 changed
  • +1 added
  • −1 removed
4 changed, 1 added, 1 removed.
3
Team offsite: plan
Removed: Date: Friday 14 March
Added: Date: Friday 21 March
Place: the boathouse by the lake
Removed: Start at 9:30 with coffee and pastries.
Added: Start at 10:00 with coffee and pastries.
Morning: review the year and the roadmap.
Removed: Lunch is at the café next door.
Removed: Afternoon: workshops in small groups.
Removed: Bring a laptop and a warm jacket.
Added: Afternoon: workshops in small groups, then a walk.
Added: Bring a warm jacket and good shoes.
Added: Dinner together at 7 pm.

Runs in your browser: nothing you paste or open is uploaded, and the texts never go in the address bar. They are kept in this tab only, until you close it or clear them.

How this works: Method, 5 sources, Checked against 4 worked examples,

How this works

Method

Lines are matched as in git diff --patience: lines both texts share at the start and end first, then lines that occur exactly once in each text (the longest run of them in order) anchor the comparison, and the gaps between anchors are compared with Myers’ O(ND) algorithm. In each change, removed lines are paired with the added lines they most resemble (character-pair similarity) and compared again word by word or letter by letter. Similarity is 2 × shared characters ÷ all characters.

How it’s tested

4 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • First published.

Every change on What’s new

How we make toolsReport a mistake

Key facts

  • Lines are matched the way git diff --patience matches them: lines that occur once in each text anchor the comparison, and the gaps between them are filled with Myers’ O(ND) algorithm (1986).

How the comparison works

Both texts are split into lines, and each line is matched with its twin on the other side. Lines the two texts share at the start and end are matched first. Then the lines that appear exactly once in each text become anchors: the longest run of them in the same order is kept, as in git’s patience diff, which keeps a moved function or paragraph from being matched against a stray closing brace or blank line. The stretches between anchors are compared with Myers’ algorithm, the shortest edit script that git, GNU diff and most diff tools are built on.

Inside each change, every removed line is paired with the added line it most resembles, so an edited sentence shows as one line changed rather than one removed and another added. Paired lines are then compared again word by word (or letter by letter), and only the words that differ get the stronger highlight.

The similarity figure is 2 × the characters both texts share ÷ the characters in both texts: 100% for identical texts, 0% for texts with nothing in common. It is the same ratio Python’s difflib reports, worked out from the comparison on screen.

Three ways to read it

Side by side keeps the original on the left and the changed text on the right, line for line, with striped gaps where a line exists on one side only. Unified is one column, each change’s old lines above its new ones, the way a patch reads, and it fits a phone. Track changes shows the new text with removed words struck through and new words highlighted, like a word processor’s review mode: the easiest way to read an edited contract, essay or resume.

Long stretches with no changes fold away, keeping three lines around each change; tap “unchanged lines” to open one, or turn on “Show all lines” under Options.

Keyboard

  • n or j next change, p or k previous change (when you aren’t typing in a box).
  • Ctrl + Z (⌘ + Z on a Mac), outside the text boxes, undoes the last Keep original, Keep change, Swap or Clear.

Sources

Frequently Asked Questions

Is the text I paste uploaded anywhere?

No. The comparison runs in your browser, on your device: nothing you paste or open is sent to a server, and it isn’t put in the page’s address either. The texts are kept in this tab only, so a reload doesn’t lose them, and they are gone when you close the tab or press Clear.

How do I compare two Word documents or PDFs?

Drop each file on its side, or use Open. Word documents (.docx) and PDFs are turned into plain text in your browser, paragraph by paragraph, and compared like any text; Track changes is usually the easiest view to read them in. Scanned PDFs have no text to compare, and old .doc files need saving as .docx first.

What do ignore case, whitespace and blank lines do?

Ignore case treats "Hello" and "hello" as the same. Ignore whitespace treats any run of spaces or tabs as one space and ignores spaces at the start and end of a line, so re-indented code or doubled spaces don’t count as changes. Ignore blank lines leaves empty lines out of the comparison; they still show, without a highlight.

What does “lines changed” mean, next to added and removed?

A changed line is one that was edited: the removed line and the added line are alike enough (by their pairs of letters) to be the same line rewritten, and the words that differ are highlighted inside it. An added line has no counterpart in the original, and a removed line none in the changed text.

Can I merge the two texts?

Yes. Each change has “Keep original” and “Keep change” (the arrows between the columns in side by side view): the first copies the original’s lines into the changed text, the second copies the changed lines into the original. Undo takes it back. When you are done, download the changed text from the ⋯ menu.

Can I get a .patch or unified diff for code?

Yes: the ⋯ menu copies or downloads a unified diff with three lines of context around each change, the format git apply, patch -p1 and code review tools read. It always compares exactly, ignore options or not, so the patch applies.

How large can the texts be?

Files up to 25 MB open, and texts of several megabytes compare in a background worker, so typing stays smooth. Long unchanged stretches fold away and very long results show 1,500 lines at a time, with a button for more.