Compare two PDFs

Find out what changed between two versions of a contract, report or draft, line by line.

or drop them here · files stay on your device · pick at least 2
We count formats and sizes. Filenames stay private unless you opt in.

Include unchanged lines
Processed on this device
  • Runs on your device
  • No sign-up or watermark
  • No fixed file size cap

The short answer

To compare two PDF files, choose the old version and the new version here. Your browser reads the text layer of each, lines them up and writes an HTML report with added lines in green and removed lines in red. Both PDFs stay on your device the whole time; nothing is uploaded. Scans need OCR first.

How to compare two PDF files for differences

  1. STEP 1

    Choose both PDFs

    Pick the original first and the revised version second. The report reads from the first file to the second.

  2. STEP 2

    Decide on context

    Leave "Include unchanged lines" off to see only the differences, or turn it on to read the changes in place.

  3. STEP 3

    Run the comparison

    Press "Compare the two". Both documents are read on your device and the counts of added and removed lines appear.

  4. STEP 4

    Open the report

    Save comparison.html and open it in any browser. Green rows marked + are new, red rows marked - were removed.

What a PDF comparison actually checks

A PDF comparison answers one question: what wording is different between version A and version B. That matters most for contracts, policies, tenders and academic drafts, where a single changed clause can be easy to miss on a read-through and expensive to miss in practice.

There are two kinds of comparison. A text comparison looks at the words stored in the file. A visual comparison looks at the rendered pages, pixel by pixel. This tool does the first kind, which is the one that catches changed figures, dates and sentences, and it ignores purely cosmetic changes such as a new font or a moved logo.

What survives, and what does not

Each PDF is opened with pdf.js and its text is rebuilt line by line, using the end-of-line markers the renderer provides. Empty lines are dropped, then the two line lists are aligned with a longest-common-subsequence diff, the same approach a code review tool uses. A line that was edited shows up as the old line removed and the new line added. The report is a single self-contained HTML file you can open in any browser or attach to an email.

What you keep

Every added and removed line of text, in document order

A count of lines added and removed at the top of the report

Page counts of both files, shown side by side in the result

An optional full view that includes the unchanged lines for context

What you lose

Visual changes are not detected: fonts, colours, spacing, images and layout

Edits are shown per line, not per word, so a one-word change flags the whole line

Scanned PDFs without a text layer cannot be compared until they have been OCRed

Very long documents can be slow, because the alignment grows with both line counts

Honest limits are published on every tool page. If a tool cannot do something well, it says so here rather than letting you find out after the download.

Compare two PDFs at a glance

InputTwo PDFs with a text layer
OutputHTML report (comparison.html)
MethodLine-by-line text diff
Runs onYour device, in the browser
Enginepdf.js
Works offlineAfter the first use

If something goes wrong

It says neither document has a text layer

Both files are scans, so they hold pictures of pages rather than words. Run them through OCR to add a text layer, then compare the OCRed copies.

Almost every line is marked as changed

The text was rewrapped, for example after a margin or font change, so lines break in different places. The wording may be the same; check a few red and green pairs side by side.

The comparison is slow or the tab runs out of memory

The alignment step scales with the number of lines in both files multiplied together. Split very long documents into sections and compare section against section.

Compare two PDFs questions

How do I compare two PDF files for differences for free?

Select both PDFs on this page and press Compare. You get an HTML report listing every line that was added or removed, with no account, no watermark and no trial. The comparison runs in your browser rather than on a server.

Are my PDFs uploaded when I compare them?

No. Both files are read by pdf.js inside your browser tab and the report is generated there too. That makes it suitable for draft contracts and other documents you would not want on a third-party server.

Can it compare scanned PDFs?

Not directly. A scan is an image of a page, so there is no text to compare. Run each scan through OCR first to give it a text layer, then compare the two OCRed files.

Does it show formatting or image changes?

No. It compares the words only. A changed font, a recoloured heading or a swapped photo will not appear in the report. For contracts and policies that is usually what you want, because the wording is what carries meaning.

Can I compare a Word document with a PDF?

Not in one step. Save the Word file as a PDF first, then compare the two PDFs. Expect some differences in line wrapping if the layouts are not identical.

Does it work on a Mac, Windows or iPhone?

Yes. It runs in any modern browser, including Safari on Mac and iPhone and Chrome or Edge on Windows and Android. Long documents are faster on a laptop than a phone, because the diff needs memory.

One of 153 file tools and planned additions. Built and tested by Arin Prajapati, last checked against the code on . canonical: https://damnfiles.com/compare-pdf
Analytics preferences

Help us understand which tools and file types people use. File contents always stay on your device.

Filename sharing is optional and off by default. Names can contain personal information. Changes apply to future events; disabling sharing does not delete earlier records.

Read our privacy policy