Home/PDF Tools/Compare PDF
🔀

Compare PDF

See exactly which lines changed between two versions

Free · No sign-up required

Finding what changed between two versions

A contract comes back from the other side marked "minor amendments". A policy is reissued. A quote is revised. Reading both documents side by side to find the difference is slow and unreliable — the changes that matter are usually small, and a single word can reverse a clause. This compares the text of two PDFs line by line and shows exactly which lines were added and which were removed.

Both files are read in your browser. Nothing is uploaded, which matters when the two documents are drafts of an agreement that has not been signed yet.

How the comparison works

Text is extracted from each document and grouped into lines by vertical position, then matched with a longest-common-subsequence diff — the same approach source control uses. Lines present in both are treated as unchanged however far apart they have moved; the rest are reported as added or removed.

MarkerMeaning
− redIn the original, not in the revision
+ greenIn the revision, not in the original
plainIdentical in both — hidden unless you ask to see the whole document

An edited line shows as one removal followed by one addition, since a changed line is not the same line. Reading the pair together tells you what was rewritten.

What it compares, and what it does not

  • It compares words. That is what people almost always mean by comparing two contracts, and it is the part that carries legal weight.
  • It does not compare appearance. A changed font, a moved logo, a different margin or a new page break produce no difference at all, because the words are identical.
  • It does not compare images. A replaced photograph or a redrawn chart is invisible to a text diff.
  • It does not read scans. A PDF with no text layer compares as empty; the tool says so rather than showing a blank result. Run it through OCR PDF first, and bear in mind that recognition errors will then appear as differences.
  • Tables come out as lines of text, because a PDF has no cells. Changes are visible but the column they belong to is not.

Reading the result sensibly

Leave the spacing option on unless you have a reason not to. A PDF stores the position of each run of glyphs rather than a line of text, so re-flowed paragraphs, justified spacing and soft line breaks differ constantly between two exports of the same content. Ignoring spacing removes a large volume of differences that are not changes.

Even so, expect some noise. Headers, footers and page numbers appear inline and shift when pagination changes, so a document that gained a paragraph on page 2 may show every later page header as a difference. Read the run of changes, not the count.

When the two documents are very long

The diff compares every line of one document against every line of the other, so memory grows with the product of the two lengths. The tool caps a comparison at four thousand lines each, which covers most contracts and reports. Beyond that, split both documents at the same point with Split PDF and compare the parts — the result is identical and each part finishes quickly.

Frequently asked questions

Why does it say the documents are identical when they look different?

The words are the same. Formatting, fonts, images and layout are not compared, because a text diff has no view of them.

Why are there so many differences in a lightly edited document?

Usually pagination. One added paragraph shifts every page break, and headers and footers then appear at different points in the text. Turn off 'only changed lines' and read around the change to see.

Can I compare a scan with a digital document?

Only after running the scan through OCR. Recognition is not perfect, so some reported differences will be OCR errors rather than edits.

Does it mark changes inside a line?

No — a changed line shows as a removal and an addition. Reading them as a pair shows what was altered.

Can I export the result?

Select the rows and copy them. The output is plain text.

Are my documents uploaded?

No. Both are read and compared in your browser.

More tools in this category

📋
Fill PDF Form
Fill in the fields of a PDF form and optionally flatten it
🖼
Extract Images from PDF
Pull every embedded image out at original resolution as a ZIP
🔎
OCR PDF
Turn a scanned PDF into text you can search and copy, in your browser
🔗
Merge PDF
Combine several PDF files into one document
Split PDF
Break a PDF into single pages or two halves
Split PDF by Size
Break a PDF into parts that each fit under a byte limit