← All articles

How to Compare Two Scanned Documents for Differences

Why a text diff cannot help you here

A scanned document is a picture of a page. There is no text in the file — just pixels arranged in the shape of letters. Paste it into a text comparison tool and there is nothing to compare.

You can run OCR first and diff the extracted text, and sometimes that is the right move. But OCR introduces its own errors, and those errors look exactly like real differences. If the tool reports that “1,500” became “l,50O”, you now have to work out whether the document changed or the OCR misread it. On a contract or an invoice, that ambiguity is the opposite of what you wanted.

Comparing the scans as images avoids the question entirely. What is on the page is what gets compared.

What visual comparison catches

  • Altered figures and dates — a changed digit is a small, sharply localised difference, and it shows up clearly against an otherwise identical page.
  • Inserted or removed clauses — text that shifts down the page produces a large, unmistakable difference region from the insertion point onwards.
  • Swapped or added signatures and stamps — the shape is completely different from whatever was there before.
  • A different print or revision — two copies of “the same” document that came off different versions of a template.
  • Re-scans of the same physical page — useful in the other direction: confirming two files really are the same document.

The two things that will trip you up

Scans of the same page are never pixel-identical, and two effects account for almost all of the noise.

Skew. A page fed slightly crooked produces a rotated image. Even one degree shifts every line of text, and a naive pixel comparison reports the entire page as different. Deskew both scans before comparing — most scanner software has this built in, and it makes the difference between a useful result and a red rectangle.

Brightness and contrast. Two passes on the same scanner at different settings, or two different scanners, give you the same page at different exposures. This produces a low-level difference everywhere and drags the similarity score down without indicating anything real.

Both are worth fixing before you compare, not after. Ten seconds of preparation saves you interpreting a meaningless heatmap.

Getting a usable comparison

  1. Scan both at the same resolution. 300 DPI is the usual choice for documents. Two scans at different DPI are partly a resize comparison.
  2. Deskew both. The single highest-value step.
  3. Crop to the page edges so both images cover the same area. A scan with an extra centimetre of scanner lid at the bottom shifts everything relative to the other.
  4. Match the orientation. Obvious, easy to get wrong on a batch.
  5. Upload both to image comparison.

You get a similarity score and a heatmap marking every region that differs.

Reading the result

A near-blank heatmap with a couple of bright spots. This is the ideal outcome: the pages are the same except in specific places, and those places are exactly what you want to look at. Zoom into each one.

Faint difference spread evenly over all the text. Usually not a content change — this is sub-pixel misalignment or a brightness difference. Check your deskew and exposure and try again.

One horizontal band, then difference everywhere below it. Text was inserted or removed at the top of that band, pushing everything after it down the page. The band is where the change starts; everything below is displacement, not new content.

Difference concentrated in one column or margin. Often a header, footer, page number, or a stamp that differs between copies. Frequently benign, but worth a look.

When the pages are different sizes

If one document was printed at a different scale, or scanned at a different DPI you cannot re-do, the comparison is measuring the scale difference more than the content. Resize one to match the other’s dimensions first. The result will be slightly softer, but it will be comparing like with like.

What this does not replace

Visual comparison tells you where two pages differ. It does not read the document, and it will not tell you whether a change is legally or financially significant. It narrows a twenty-page document down to the three places worth reading carefully — which is usually the hard part.

For documents that do have a real text layer, comparing the text directly is better: see comparing PDF documents.

Try it

Compare two images → — upload both scans and get a similarity score with a difference heatmap. Deskew first; it is worth the ten seconds.

Stop hunting for differences by hand. DiffALL spots every change between any two files — automatically.

Compare your files — free