Compare Two PDFs
Compare two PDFs line by line in your browser: removed and added lines side by side, with a similarity score. Neither file is uploaded.
What Compare Two PDFs does
Opens both documents, recovers their text line by line, and shows what was removed, what was added and what stayed the same. It answers the question a reviewer actually asks — what changed between these two versions — without reading either document twice: a revised contract, a policy that went round for review or a translation checked against its proof all come down to a handful of lines once the two are aligned instead of compared by eye.
How to use it
Choose the original on the left and the revised version on the right, then press Compare. The button stays disabled until both files are chosen, because a comparison against an empty side is not a comparison. The summary names how many lines were added, how many were removed and how many stayed unchanged, and gives a similarity percentage measured against the longer document. The table puts removed lines in the original column and added lines in the revised column with both line numbers, so a rewritten paragraph reads as one row rather than as two unrelated ones.
Why it runs in your browser
Both files are read with the browser File API and decoded by pdf.js in the tab. Neither file is uploaded, and the page sends no request carrying your documents. That matters most for exactly the material this page is built for: a contract, an appraisal, or a draft nobody has published yet. The comparison also keeps working offline once the page has loaded.
What it will not do
It compares text, not appearance. A reflowed table or an image nudged down the page is not detected. A document with no text layer is reported as a scan rather than as an identical file, because a scan needs OCR before there is anything to compare. A comparison is capped at 5 000 lines on each side, at 25 MB per file and at 200 pages, and a document beyond a limit is refused with that limit named rather than left to freeze the tab.
Choose an original PDF and a revised PDF and this page reads the text of both in the browser, groups it into visual lines, and shows a line-by-line table with removals on the left and additions on the right.
Above the table it prints a summary: how many lines were added, how many removed, how many unchanged, and a similarity percentage over the longer of the two documents.
Both files stay in the tab. The page uses a bundled PDF reader, not a server, and refuses anything larger than 25 MB, longer than 200 pages or more than 5 000 lines on one side.
How two documents are lined up
Text fragments from the PDF reader are grouped by baseline, so items that sit on the same visual line become one line and a word space is inferred from the gap between fragments. Nothing is reflowed before comparison.
The diff is a Myers line diff over the line text alone. The page number is carried for the label but is deliberately excluded from the comparison key, so a paragraph that reflows onto an extra page is not reported as every line changing.
The similarity figure is unchanged lines divided by the longer side's line count, rounded to a whole percent. Two identical documents score 100 even if one has a blank trailing page.
- Files: two PDFs, up to 25 MB each
- Pages: up to 200 per document
- Lines: up to 5 000 per side
The cases it cannot answer
A scanned PDF has no text layer, and the page says so rather than reporting every line as removed. Comparing scans needs OCR, which this page does not run.
Only text is compared. A moved image, a changed chart, a different font and a recoloured table cell all compare as identical if the words are the same, so a visual review still needs the two files side by side.
How to use the two file inputs
Choose the original PDF in the first file input and the revised PDF in the second. Both stay in the tab and each must be within 25 MB, 200 pages and 5 000 lines a side.
Read the summary of lines added, removed and unchanged with the similarity percentage, then the line-by-line table with removals on the left and additions on the right.
What to Expect
Best for
- Checking that a contract revision changed only the clauses you expected
- Confirming a regenerated report matches the one that was signed
- Finding which paragraphs were added between two drafts
Not ideal for
- Scanned documents with no text layer, which need OCR first
- Visual comparison of layout, images or colour
- Files over 25 MB or documents longer than 200 pages
What this tool keeps
- Line text compared exactly, including case and punctuation
- Removals and additions side by side, with a line number per side
- A similarity percentage over the longer of the two documents
What may need cleanup
- Line breaks created by the PDF's own text layout, which can split a sentence in two
- A reflowed paragraph that reads as several changed lines rather than one
- Anything visual, which the diff cannot see
Common errors
- Comparing two scans and reading the no-text-layer message as a failure of the tool
- Treating a 98 percent similarity as proof that nothing important moved
- Expecting header and footer text to be ignored, when it is compared like any other line
Example use cases
- A redline check before signing a revised contract
- Verifying a generated invoice against last month's
- Diffing two exported reports to find the changed paragraph
Sample input
A two-page contract and its revision, which adds one clause and changes a payment date.
Sample output
One line added, one removed and the remaining forty-one unchanged, with a similarity of 98 percent.
Who this is for
- Anyone reviewing a revised contract or policy
- Finance teams checking a regenerated document
- Writers proofing two drafts of the same export
Frequently asked questions
How does the PDF comparison line up two documents?
It reads the text of both in the browser, groups it into visual lines, and shows a line-by-line table with removals on the left and additions on the right.
Does it compare layout, images or colour?
No. It compares extracted text only, so anything visual is outside the diff.
Why does a reflowed paragraph show as several changed lines?
The comparison works line by line from the PDF's own text layout, so a reflowed paragraph reads as multiple changes.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.