Skip to content
DeviceCheckHub

Compare PDF

Choose two versions of a PDF to see exactly what changed: every edited, added and removed sentence with its page, and everything that looks different on each page. Your files never leave your device.

No file chosen

No file chosen

Choose the original PDF and the changed PDF. They stay on your device.

How to compare two PDF files

  1. Choose the original PDF in the first box and the changed PDF in the second, or drop both files on one box. Swap files puts them the other way round.
  2. Read the summary: how many sentences changed, were removed or were added, and on which pages.
  3. Go through the list with Next change. Removed words are marked in red in the old sentence and new words in green in the new one, with the page of each.
  4. Open Visual differences to see each page with everything that looks different in red, including pictures, signatures and layout. Pages with differences are listed with how much of the page changed.
  5. Press Download differences to save the list as a text file.

How the text comparison works

Both PDFs are read with PDF.js, the PDF reader built into Firefox, and the text of every page is taken out in reading order. Line breaks that come only from the page layout are removed, and words split by a hyphen at the end of a line are joined again, because in another version of the file the same words may wrap in a different place. The text is then cut into sentences.

The two lists of sentences are matched with the same method programmers use to compare versions of code (the Myers difference algorithm), which finds the smallest set of removals and additions that turns one document into the other. A sentence that was edited is shown once, as changed, with the changed words marked inside it, so a fixed typo, a new date or a different amount is easy to spot. Choose changed letters to mark single characters instead, which helps with numbers such as 1,250 and 1,520.

Because the text is matched across the whole document, a paragraph that moved to the next page after an insertion is found there and not reported as removed and added. Each change shows its page in the original and, when it moved, its page in the changed file. Ignore capitals treats “Agreement” and “agreement” as the same, and Ignore extra spaces skips differences that are only spacing.

How the visual comparison works

Text is only part of a document. A replaced logo, a changed chart, a new stamp, a moved signature or different colors don’t change any words. Visual differences draws page 1 of both files at the same size, then page 2, and so on, and compares them pixel by pixel. Every spot where the two pages differ clearly is painted red on a faded copy of the changed page, and the page list shows how much of each page differs. Tiny differences in smoothing at the edges of letters are ignored, so two copies of the same page show as the same.

Pages are compared by number. If a page was inserted near the start, every later page is shifted and will look different, even though the text comparison shows that only one page was added. Side by side shows the two pages next to each other at the same size, which is the easiest way to see such cases.

Tips for a clear result

When comparing PDFs helps

What it can’t do

The text comparison only knows the words a PDF stores. A scanned document has no words, only a picture of them; the tool tells you and compares the pages by how they look, and you can make a scan searchable first with OCR PDF. Tables are read cell by cell in the order the file stores them, so a table that was rebuilt can show more changes than were really made. Form answers typed into fields and comments added in a PDF reader are not part of the page text. Fonts, sizes and colors of text don’t count as text changes, but show in the visual comparison.

Locked PDFs that need a password to open can’t be read; remove the password first with Unlock PDF if you are allowed to. To compare plain text, Word documents you’ve copied from or two versions of any other text, use the text compare tool.

Private by design

Many online PDF compare services ask you to upload both files to their servers. Here, the files are opened in your browser’s memory and never sent anywhere, and they are gone when you close or reload the page.

PDFs are read and drawn with PDF.js by Mozilla (Apache 2.0 license), with its character maps from Adobe, the Foxit and Liberation fonts, color profiles, and image decoders built from PDFium’s JBIG2 (build), OpenJPEG (build) and qcms (build).

Frequently asked questions

Are my PDFs uploaded anywhere?

No. Both files are opened and compared by your browser on your device, using PDF.js. Nothing is sent to a server, so it is safe for contracts, medical letters and other private documents.

Why does it compare sentences rather than lines?

Lines in a PDF are set by the page layout. When one word changes, every line after it in the paragraph can wrap differently, and a line-by-line comparison would mark all of them. Comparing sentence by sentence shows only the sentence that changed, with the changed words marked inside it.

Can it compare scanned PDFs?

A scan is a picture of a page with no text in it, so there are no words to compare. The tool says so and compares how the pages look instead. To compare the words of a scan, make it searchable first with the OCR PDF tool, then compare the results.

Does it find changes in pictures, colors or layout?

The text comparison only looks at words. Visual differences draws each page of both files and marks in red every spot that looks different, so changed pictures, colors, stamps, signatures and moved blocks show up there.

What if the PDFs have a different number of pages?

The text is matched across the whole document, so a sentence that moved to another page is not counted as removed and added. Visual differences compares pages by number, so pages after an inserted page will look different; the page list says which pages are only in one file.

Can I save the list of differences?

Yes. Download differences saves a plain text file listing each change with its page numbers, the old sentence and the new one, ready to attach to an email or paste into a review.

Is there a size limit?

Files up to 200 MB each can be opened. Large documents take longer, because every page is read and, for the visual list, drawn. The first 100 pages are checked for visual differences straight away; later pages are checked when you open them.

Last updated · About DeviceCheckHub