Home › PDF Tools › Compare PDF

Compare PDF

Find every text change between two versions of a PDF in seconds. Added lines are green, removed lines red, and changed lines show exactly which words were edited, with page numbers on both sides. Both files are read in your browser and never uploaded.

Choose two PDFs to compare. The text of both files is extracted page by page and every added, removed or changed line is highlighted. Nothing is uploaded.

Advertisement
Advertisement

How to use the Compare PDF

  1. Open the original PDF in the left box and the changed PDF in the right box (drop them or click to choose).
  2. Press Compare PDFs. The text of every page is extracted and compared; this takes a second or two for most files.
  3. Review the differences: green is added, red is removed, and changed lines highlight the edited words. Use Next change to jump through them.
  4. Adjust the view: switch between side-by-side and inline, show only changes, or ignore case and spacing.
  5. Save the result with Download report (HTML) or Copy differences.

How the comparison works

  1. Text extraction. pdf.js reads the text layer of every page and rebuilds the lines from the position of each piece of text, so the result follows the reading order of the page.
  2. Line alignment. The two documents are compared as a whole with the Myers difference algorithm (the same method used by git diff), which finds the smallest set of added and removed lines. Because the whole text is aligned, an inserted page does not throw off the rest of the comparison.
  3. Word highlighting. When a removed line and an added line share at least 30% of their words, they are shown as one changed line and the algorithm runs again on the words, so you see exactly which words were edited.

Reading the results

MarkerMeaning
− red lineLine exists only in A (the original): it was removed.
+ green lineLine exists only in B (the changed file): it was added.
~ changed lineLine was edited. Struck-through red words were removed, green words were added.
A · page 2 ⟷ B · page 3Where each side's lines come from, useful when pages were inserted or removed.
Similarity2 × unchanged words ÷ (words in A + words in B).

Tips for accurate results

  • Keep Ignore extra spaces on. Different PDF producers place spaces differently, and this option hides changes that are only spacing.
  • Re-flowed paragraphs can show as changed lines even when the words are the same, because the line breaks moved. The word highlights show that nothing else changed.
  • Scanned documents need OCR first. To check what text a PDF contains, open it in PDF to Text.
  • To compare plain text or code you have already copied, use Text Compare.

Frequently asked questions

How do I compare two PDF files for differences?

Choose the original PDF on the left and the new version on the right, then press Compare PDFs. The tool extracts the text of both files, aligns them line by line and highlights what was added, removed or changed, down to individual words.

Does it compare images, formatting or layout?

No. This tool compares the text content. Changes to images, colors, fonts or exact positions are not reported, and a paragraph that only re-wraps differently can show as a changed line. For a visual check, open both files in the PDF Viewer side by side.

Can it compare scanned PDFs?

Only if the PDF contains a text layer. Scanned pages are pictures, so there is no text to compare; the tool tells you when a file has no selectable text. Run the scans through OCR software first and then compare.

What happens if pages were added or removed?

The comparison runs over the whole document, not page against page, so an inserted page shows up as added lines and the rest of the document still lines up correctly. Page numbers on each side show where each line comes from.

How is the similarity score calculated?

Similarity = 2 × unchanged words ÷ (words in the original + words in the changed file), shown as a percentage. Identical text scores 100%, and two texts with nothing in common score 0%.

Are my PDFs uploaded to a server?

No. Both files are opened with pdf.js inside your browser tab and compared on your device, so confidential contracts and reports never leave your computer.

Is there a size limit?

There is no fixed limit, but very long documents with thousands of changes take more memory. Documents of a few hundred pages compare in seconds on a typical computer.

Related tools

PDF to Text ConverterExtract the text from any PDF page by page, then copy it or save it as a TXT file.Text CompareFind the differences between two texts.PDF Word CounterCount words, characters and lines in a PDF, page by page, with top words and CSV export.PDF Page CounterCount the pages of many PDFs at once, with totals, page sizes and a CSV export.Merge PDFCombine several PDF files into one document.Compress PDFReduce PDF file size while keeping it readable.JPG to PDFCombine JPG photos into one PDF with page size, margins and orientation options.PDF to WordConvert PDF files to editable Word documents.PDF to ExcelExtract tables from PDF files into an Excel spreadsheet (XLSX) or CSV, right in your browser.PDF to JPGTurn PDF pages into high-quality JPG images.PDF to PNGConvert PDF pages to PNG images with custom DPI and transparent background.Word to PDFConvert Word DOCX documents to PDF.Image to PDFConvert JPG, PNG, WEBP and more into a PDF.Split PDFExtract pages or split a PDF into separate files.Delete PDF PagesRemove pages from a PDF using a visual thumbnail grid.Rotate PDFRotate one page or all pages of a PDF by 90, 180 or 270 degrees.Add Page Numbers to PDFNumber PDF pages with your choice of position, format and font.Watermark PDFStamp a text or logo watermark on PDF pages with custom opacity.Invoice GeneratorCreate professional invoices and save them as PDF.Sign PDFDraw, type or upload a signature and place it on any PDF page, free and private.Fill PDF FormFill in PDF form fields online: text boxes, checkboxes, radio buttons and dropdowns.PDF Metadata EditorView and edit a PDF's title, author, subject, keywords and dates, or clear them all.Text to PDF ConverterTurn plain text or a .txt file into a clean PDF with your font, size, margins and page size.HTML to PDF ConverterPaste HTML and CSS, preview it as pages and download a PDF, safely in your browser.Markdown to PDF ConverterWrite or paste Markdown, preview it with a clean theme and export a polished PDF in seconds.Excel to PDF ConverterConvert Excel and CSV sheets into tidy, paginated PDF tables with repeated headers.Flatten PDFFlatten PDF form fields and annotations into the page so they can no longer be edited.Grayscale PDFConvert a color PDF to grayscale or pure black and white for printing, right in your browser.PDF ViewerOpen and read PDF files in your browser with zoom, search, thumbnails and fullscreen.Organize PDFReorder, rotate, delete and duplicate PDF pages with drag-and-drop thumbnails.Crop PDFTrim PDF margins by dragging a crop box on the page, for all pages or selected ones.Resize PDFChange PDF page size to A4, Letter, Legal, A3 or custom and scale content to fit.Extract Images from PDFPull every embedded photo and graphic out of a PDF as PNG or JPG, or save pages as images.Redact PDFBlack out names, numbers and any text in a PDF for real: the hidden text is removed, not covered.PDF EditorAdd text, whiteout, shapes, images and drawings to any PDF page, then save a new PDF.Resume BuilderFill in a simple form, pick one of 3 clean templates and download your resume as a PDF.PDF to PowerPointTurn every PDF page into a PowerPoint slide (PPTX) in 16:9, 4:3 or the PDF's own size.PDF to MarkdownConvert PDF to clean Markdown with headings, lists, tables, bold, italics and links.PDF to HTMLConvert PDF to a clean, responsive HTML page or an exact positioned layout, in your browser.Insert Pages into PDFInsert blank pages or pages from another PDF anywhere in your document, privately in your browser.Add Header and Footer to PDFAdd header and footer text with page numbers, date and file name to every PDF page.Invert PDF ColorsTurn a PDF into dark mode: invert colors, keep hues or use a night sepia theme for easy reading.PDF N-UpPrint 2, 4, 6, 9 or 16 PDF pages per sheet with your own order, margins and borders.PDF Booklet MakerTurn a PDF into a print-ready folded booklet: pages imposed 2 per sheet in saddle-stitch order.PDF to Long ImageStitch all PDF pages into one tall PNG or JPG image, with gap, width and page range options.PNG to PDFConvert PNG images to one PDF, keeping transparency or filling it with white or any color.HEIC to PDFConvert iPhone HEIC photos into one PDF in your browser, with page size, margins and reordering.CSV to PDFTurn a CSV file into a clean, paginated PDF table with repeating headers.Add Stamp to PDFStamp APPROVED, PAID, DRAFT or custom text with a date onto any PDF page.Remove Blank Pages from PDFFind and delete empty or near-blank pages in a PDF automatically.