HomeGuides › Comparing two PDFs

How to compare two PDFs and find what changed

Somebody sends a revised quotation, a re-issued report, version four of a contract. Reading both side by side is slow and the thing you miss is always the thing that mattered. Comparing them properly is possible — but the comparison itself can mislead you, and knowing how is most of the skill.

The trap: comparing page one with page one

The obvious approach is to line the documents up page by page. It works until somebody inserts a page. From that point on, every page is compared with the wrong one, and a tool that does this reports that the entire second half of the document was rewritten. The real change — one page added — is buried under hundreds of false ones.

A comparison worth trusting pairs the pages first, by how much text they share, allowing for insertions and deletions. Pages that have no partner are reported as added or removed, which is what actually happened. Check the page mapping before you read anything else: if it looks wrong, everything downstream is wrong too.

The second trap: normalising away the change

Any comparison has to decide what counts as a difference. Ignoring spacing is safe — a line that wrapped differently is not a change in wording. Beyond that, each option quietly hides something:

Whatever a tool does by default, digits, minus signs, decimal points and currency symbols should never be normalised. A comparison that reports 1,840.00 and 1,960.00 as the same is worse than no comparison at all, because you will trust it.

Text and appearance are two different questions

There are two ways to compare a page, and each finds things the other cannot.

Comparing the text

A PDF stores text as pieces placed at coordinates, not as sentences. The reading order has to be reconstructed from where those pieces sit, which is reliable on ordinary documents and fallible on complicated layouts — two columns, tables, sidebars. When the order comes out wrong, the comparison reports changes that are only rearrangement. Good tools say when they are unsure.

Comparing the pictures

Rendering both pages and comparing them pixel by pixel finds everything the text comparison cannot: a changed diagram, a moved logo, a stamp, a signature, different spacing. It also finds a great deal of nothing, because the fuzz around the edges of letters differs slightly between any two renderings. That is why there are thresholds — how different a pixel must be, and how large a changed area must be — and why both of them can hide a small real change. Any honest tool shows you the settings it used.

Do not add the two counts together. An edited sentence is one text difference and one changed area; adding them counts it twice while sounding more precise.

Scanned documents

A scan has no text in it at all — it is a picture of a page. It can only be compared visually, which will show you where something changed but can never quote the wording. Anything describing that as a text comparison is wrong. If you need the words, the document has to go through text recognition first, and that introduces its own errors which will then appear as differences.

Pages of different sizes

If one version is A4 and the other US Letter, a tool that stretches one page to fit the other will report that every line moved. The right behaviour is to compare them at their actual sizes and tell you the geometry differs, so you can see it is the paper that changed and not the content.

What “no differences” actually means

There is an important distinction between three statements:

Be wary of any tool that reports the strongest of these when it has only checked the weakest.

Working through the results

Doing it without uploading either document

Contracts and quotations are exactly the documents that should not be posted to a website for comparison, particularly two versions of the same one. PDF Compare does all of the above in your browser: both files are read by code running on the page, the page mapping and the settings appear in the report, and nothing is uploaded or stored.

Related: Text Compare for prose rather than PDFs, and Spreadsheet Cleanup & Reconciliation for comparing two exports of the same table row by row.