Loona Automation logoLoona PDF Tools
Home › PDF Tools › Compare PDF

Compare PDF Files Online - Free

In short: the Compare PDF tool reads the text of two PDF files page by page and shows you exactly which lines were removed, which were added and which stayed the same - a summary first, then a highlighted page-by-page diff.

Someone sent you version 2 of a contract, assignment or report and you need to know what actually changed? Load the original as Document A and the new file as Document B. In seconds you get a summary of identical, changed and extra pages, and every changed line highlighted - without reading both documents side by side yourself.

Document A - Original
Click to choose the first PDF
or drag & drop it here
Document B - Revised
Click to choose the second PDF
or drag & drop it here
Private by design: your files are processed 100% in your browser with JavaScript. They are never uploaded to a server, never stored and never seen by us - close the tab and everything is gone.

How to compare two PDF files

  1. Choose the original PDF as Document A and the revised PDF as Document B.
  2. Click "Compare PDFs" and read the summary: how many pages are identical, changed, or only in one file.
  3. Scroll through the page-by-page diff - lines removed from A are shown in red, lines added in B in green, unchanged lines in grey.

What is compared - and what is not

This tool compares the extracted text of the two documents, the same text your PDF reader can select and copy. That makes it reliable for spotting edited wording, changed numbers, deleted clauses and added paragraphs. Please keep its limits in mind:

  • Text only. Changes to images, logos, fonts, colours, spacing or layout are not detected - two pages can look different and still compare as "Same" if their text is identical.
  • Scanned PDFs show as empty. A scan is a photograph of a page and has no text layer. If a page reports no text, it is almost certainly scanned - run it through OCR first, for example with the free Image to Text (OCR) tool on Loona Text Tools, then compare the text-based result.
  • Pages are matched by number. Page 3 of A is compared with page 3 of B. If a page was inserted near the front, every following page may show as changed even if its text only moved - the summary still tells you the full picture.
  • Whitespace is tidied. Extra spaces and line-break differences from the PDF's internal storage are normalised, so purely cosmetic spacing does not drown out real changes.

Popular PDF Tools

Frequently Asked Questions

What exactly does this PDF comparison tool check?

It compares the extracted text of the two PDFs, page by page and line by line. Lines removed from the first document and lines added in the second are highlighted. It does not compare images, fonts, colours or layout.

Why does my scanned PDF show no text to compare?

A scanned PDF is a picture of pages and has no text layer for the tool to read. Run it through OCR first - for example the free Image to Text (OCR) tool on Loona Text Tools - save the result as a text-based PDF, and then compare.

How are the pages matched between the two files?

Page 1 is compared with page 1, page 2 with page 2, and so on. If one document has more pages, the extra pages are reported as only in A or only in B instead of being silently ignored.

Are my PDF files uploaded to a server?

No. Both files are opened and compared entirely inside your browser with JavaScript. Nothing is uploaded, stored or seen by us.

What does the similarity percentage mean?

It is the share of text lines that stayed the same across both documents: twice the number of unchanged lines divided by the total lines in A plus B, as a percentage. 100% means the extracted text is identical.

How it works

Each file is opened in your browser with pdf.js - the file is never uploaded - and the text of every page is extracted item by item. Items that sit on the same visual line are grouped together, extra whitespace is collapsed, and blank lines are dropped, giving a clean list of text lines per page. The two versions of each page are then compared with an LCS (longest common subsequence) diff, the same technique programmers use to compare document versions: lines that appear in both, in the same order, are marked unchanged; the rest are reported as removed from A or added in B. Pages whose line lists match exactly are counted identical, pages paired by number with any difference are counted changed, and pages beyond the shorter document's length are counted as only in A or only in B. The similarity percentage is twice the unchanged line count divided by the total lines in both documents.

Worked example

A supplier emails you a revised 12-page quotation. You load the original as Document A and the new file as Document B. The summary shows 10 identical pages, 2 changed pages and 98% text similarity. On page 4 the diff highlights one red line - "Delivery within 30 days" - and one green line - "Delivery within 45 days" - and on page 9 a new green line adds a handling fee that was not in the original. Instead of re-reading all 12 pages, you go straight to the two changes and ask the supplier about them.

Frequently asked questions

What if a whole page was inserted at the beginning?

Because pages are matched by number, an inserted first page shifts everything: page 1 of B is compared with the old page 1, and so on, so most pages will show as changed. The line-level diff still shows the real edits, and the "only in B" count at the end tells you a page was added. For a cleaner result, extract the inserted page with our Extract Pages tool and compare the remaining pages in order.

Can it compare password-protected PDFs?

No. pdf.js cannot open an encrypted file without its password, and this tool never asks for one. Remove the protection in the software that created the file first, then compare the unlocked copies.

Does a change in formatting count as a difference?

No. Bold text, a new font or moved margins do not change the extracted text, so they are not reported. Only added, removed or edited words and numbers are.

How large a document can I compare?

There is no fixed page limit. Very long documents (hundreds of pages) take longer because every page is read and diffed on your own device, and extremely dense pages fall back to a simpler line-matching pass - the summary counts stay correct either way.

Why do some lines look split or joined compared with the printed page?

A PDF stores text as positioned fragments, not as sentences. The tool groups fragments that share a visual line, which matches the printed layout in the great majority of documents; two-column layouts can occasionally interleave. The words themselves are always the document's real text.

Related PDF Tools

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.