Compare PDFs & Overlay Drawings

Compare text and drawings between two PDFs

Compare text and drawings between two PDFs

1Choose file2Settings3Process4Save

Choose a PDF and its contents will be analyzed and shown here.

Files are processed only in this browser. Nothing is uploaded to a server.

Visually compare two PDFs page by page to see what was added or deleted

Continue in another tool
Task settings
Comparison settings
Original—RevisedAdd one more PDF as the revised version
Overlays rendered pages pixel by pixel to find changes in images, shapes and layout

Remove the password from an encrypted PDF first. The whole file is rewritten, so any existing digital signature becomes invalid. Keep the original and check the result.

About Compare PDFs & Overlay Drawings

There are two ways to ask what changed between two PDFs. Text comparison extracts the words and lines them up; visual comparison renders both pages and compares pixels. Text comparison pins down edited sentences precisely but is blind to anything that isn't text — a stamp, a signature, a line on a drawing. Pixel comparison sees everything, but if a paragraph moves down by one line it paints half the page as changed.

The main tab of this tool uses both. It first diffs the documents word by word, marking removed words with red boxes on the original and added words with green boxes on the revision. It then renders each matched page pair at the same size and marks remaining pixel changes — excluding areas the text diff already explained — with orange dashed boxes. Two more tabs cover a red/cyan overlay for drawings and a quick page-count and page-size check.

Text diff: the whole document as one stream, not page by page

Words are extracted from both files with PDF.js and compared using Myers' O(ND) algorithm, the same family behind Unix diff and git. Because the comparison runs over the entire document rather than page by page, a paragraph inserted on page 2 doesn't make every later page look changed just because content shifted down. Pages are then paired by the number of words they share and shown side by side.

Before comparison each word is normalized with Unicode NFKC, so full-width “ABC” equals “ABC” and the ligature “fi” equals “fi”. Ignore-case and ignore-punctuation options treat “Agreement.” and “agreement” as the same. If the documents differ enormously (an edit distance above 4,000 words), the tool stops refining and reports the differing middle as one removal plus one addition, so comparing two unrelated documents won't give a useful result.

When the text diff reports something that didn't really change

  • Hyphenation: if re-typesetting turns “docu-” + “ment” into “document”, it appears as a changed word.
  • Reading order: in multi-column layouts or documents full of text boxes, the order in which text is stored can differ between versions, producing remove/add pairs for identical content.
  • Invisible changes: same words in a new colour, weight or size don't show in the text diff at all (the pixel pass may catch them if the rendering differs enough).
  • Scans: with no text layer, only the pixel comparison has anything to work with.

Pixel false positives: shifted lines and re-exported files

Matched pages are rendered 900 px wide. A pixel counts as different when the largest of its R, G, B channel differences exceeds a threshold: 110, 64 or 32 (on a 0–255 scale) for low, normal and high sensitivity. The page is divided into 10×10 px cells; a cell is flagged when it contains at least 12, 5 or 2 differing pixels respectively, and touching cells merge into one box. On an A4 page one cell is about 2.3 mm.

The classic false positive is reflow. Add a few words to line 3 and the paragraph grows by a line; every line below moves down a few pixels, so the pixels differ even though the words don't. So pixel boxes that overlap a text change are removed, and words the text diff matched as unchanged but that changed position are masked out of the pixel pass at both their old and new spots. Things that are not text, such as table rules, underlines or pictures, can still move with the text and keep orange boxes, so read the red and green boxes first.

Re-exporting the same source from a different program also changes font hinting and anti-aliasing, so glyph edges differ slightly. Those differences usually stay under 64 and are filtered at normal sensitivity, but high sensitivity can paint whole pages orange. If you only want to know whether a stamp or signature disappeared, low sensitivity is the calmer choice.

The overlay tab and the page count/size tab

The overlay tab reproduces an old trick for checking drawing revisions: the original is tinted red and the revision cyan. Where both have ink the result is dark; where only one does, that colour stands out. Pages are paired by position (page 1 with page 1), and pairs whose sizes differ by more than 2 pt are listed rather than overlaid. If the whole drawing moved a few millimetres in the revision, every line shows up doubled in red and cyan, and this tab has no control to realign them.

The page count/size tab reads no content at all: it compares the number of pages and each page's MediaBox, CropBox (visible area) and /Rotate. It answers “did pages get added, or did the paper size, cropping or rotation change?” in seconds. It can't tell that pages were reordered. Because it works by index, a page inserted in the middle looks like one page added at the end, plus size changes for any later pages that differ in size.

Worked examples

A contract revision with one new clause

Input
Original 12 pages, revision 13. A new clause of about 60 words on page 4; on page 9 “$30,000” became “$35,000”
Output
2 changes: ~60 words added on revision page 4; page 9 “$30,000” removed, “$35,000” added

Later pages shift by one, but because the diff runs over the whole document, pages 5–13 aren't reported as rewritten. Lines below the new clause on page 4 keep their words, so they are left out of the pixel pass too; only rules or pictures that moved with them may carry orange boxes.

How sensitivity treats a lighter grey

Input
Same spot: original RGB(40,40,40), revision RGB(90,90,90)
Output
Difference 50 — ignored at normal (64) and low (110), counted at high (32)

Slightly lighter grey text doesn't get flagged at normal sensitivity. At high sensitivity two such pixels in one 10 px cell are enough for a box.

Quick check with the page count/size tab

Input
A: 20 pages, all A4. B: 21 pages, a US Letter page inserted as page 6
Output
“Added in B: page 21”, plus a size change reported for page 6

The tab compares by index, so it can't say the new page is page 6; it only notices one extra page and that page 6 is now a different size. The main compare tab would align the pages by content.

How to use it

  1. Add the original and the revised PDF (the swap button reverses them).
  2. Choose ignore-case, ignore-punctuation and pixel sensitivity, then compare.
  3. Click entries in the change list to jump to them, and save the annotated report PDF and text summary.

Frequently asked questions

Only a line moved, but I still see orange boxes.

Lines that moved with their words unchanged are left out of the pixel pass, so remaining orange boxes are usually rules, underlines or pictures that moved along. The red and green boxes are the actual wording changes. You can lower or switch off pixel sensitivity.

Can I compare two scanned documents?

Only the pixel pass works. Even a slight difference in scan position makes the whole page differ, so results will be rough.

Will it catch a change in text colour?

Not in the text diff. If the colour difference exceeds the threshold, the pixel pass marks it in orange.

Does the page count/size tab detect reordered pages?

No. It only compares page count and paper size. Use the main compare tab for order and content.

What do I get to keep?

A side-by-side report PDF with the boxes drawn in, and a plain-text summary of every change.

Sources

Last reviewed:

Privacy and how data is handled