PDF Diff
PDF Diff
How to compare two PDFs
Drop both PDFs
Left for the original, right for the revised. Order matters: getting it backwards shows additions as deletions.
Click Compare
The line above the results says what was found and, just as important, what could not be compared, such as a scanned page. If more than 4,000 lines are added or removed, which is about 2,000 edited lines because an edited line counts as one of each, the tool says the files are effectively different documents.
Read the result
A changed line sits beside its replacement with the changed words marked, and the page number of each side next to it. Long runs of unchanged lines are collapsed; untick the option to see everything. If one inserted word has reflowed a whole paragraph, tick Ignore line wrapping for a plain list of what changed.
Export it
Download .diff.txt saves the result as plain text, headed by the same conclusion and notes. It is a readable listing, not a patch.
What a PDF comparison can and cannot tell you
A counterparty returns the contract you sent with "minor changes"; a procedure is reissued; a paper comes back from review. The question is always what exactly changed, and the usual answers are a paid desktop feature or a website that uploads both confidential drafts to its own server. This tool does it in your browser, and it is honest about the limits of doing it from text.
How the comparison works
Each PDF's text is extracted with pdf.js and rebuilt into lines. The lines are compared with the algorithm Eugene Myers published in 1986, "An O(ND) Difference Algorithm and its Variations". It finds a shortest edit script: the fewest lines to remove and add to turn the original into the revision. GNU diff and Git build on the same algorithm but do not promise the shortest by default: the GNU diffutils manual calls its result "near-minimal", and Git's documentation describes its default as "the basic greedy diff algorithm" and offers a separate --minimal option for the smallest diff. This tool computes the exact shortest script, the same line counts as git diff --minimal. Its cost grows with the number of differences, so a long contract with a few edits is quick, and extracting the text is the slow step. Lines that changed are then compared word by word, which is how the marks appear.
Re-wrapped paragraphs
A line diff sees wrapping as change. Insert one word near the start of a paragraph and every following line of that paragraph shifts, even though nothing else was edited. Ignore line wrapping compares the document as one long run of words instead, so that paragraph reports one insertion. A word split by a hyphen at a line end is rejoined first. Page headers and footers stay in the text, so a running "Page 4 of 30" that became "Page 4 of 31" counts as a change on every page.
Moved text and multi-column pages
A moved paragraph shows as removed from one place and added at another, because a diff has no notion of "moved". Multi-column pages and tables can extract in an order that does not match reading order, so compare those by eye. If a document is too messy, extract both to text with a desktop tool such as Poppler's pdftotext and compare those.
What the comparison sees
We built pairs of PDFs that differ in one way each and ran them through this page in Chrome 156 on 2 November 2026.
| What changed | Result |
|---|---|
| A word or number in the text | Shown, with the word marked |
| A form field value | Shown as a [Form field] line |
| A sticky-note comment | Shown as a [Comment] line |
| White text on a white page | Shown: the comparison reads text that is not visible |
| A scanned page added | Not compared, and the result says which page |
| Two scanned PDFs | Nothing compared, and the result says so rather than reporting a match |
| An image, logo or signature picture swapped | Not seen. The result says the files are not byte-identical |
| Bold, font, colour, position | Not seen. Same note |
| Nothing at all | Says the files are identical, byte for byte |
FAQ
-
No. Both PDFs are read into browser memory, and the text is extracted and compared there. The page itself still loads the site's own scripts, and ads if you have accepted them, but your files are not part of any request. You can check in DevTools → Network.
-
Only if the result says the files are byte-identical. Otherwise it means the text, form fields and comments match. A swapped image, a moved signature or a changed font would not show, and the result tells you when the files differ in ways it cannot read.
-
No. A scanned page is a picture with no text to compare. The result names any page that draws an image and has no text, so a scanned signature page in an otherwise text contract is called out, not silently skipped. Run OCR first, for example Adobe Acrobat's Recognize Text, then compare. Text on top of a scanned image, as OCR produces, is compared like any other. A page mixing text and a scanned image is treated as a text page, and only its text is compared.
-
Document length is rarely the limit; the number of differences is. The slow step is extracting the text, which pdf.js does page by page. If more than 4,000 lines are added or removed, which is about 2,000 edited lines because an edited line counts as one removal and one addition, the tool stops and says the files are effectively different documents. With Ignore line wrapping ticked, the same limit counts words.
-
A header naming the two files with the conclusion and any notes, then every line in order: two spaces for unchanged,
-for removed and+for added, with its page. It is meant to be read or attached to an email. It is not a unified diff, so patch tools will not accept it. -
A file that opens without a password, with only restrictions on printing or copying, can be compared. A file that needs a password to open cannot; the tool says so. Remove the password first in software that knows it.
-
Yes. The same two files always give the same result: the algorithm has no randomness and no AI. Where more than one minimal answer exists, the tie is always broken the same way.
Method & sources
How it computes
Extracts each PDF's text with pdf.js and rebuilds lines from it, adding form-field values and comments as labelled lines. Lines are compared with Myers' O(ND) algorithm, changed lines word by word, or the whole text word by word to ignore wrapping. Layout, fonts and images are not compared; a page with no text is reported by number, and SHA-256 of each file shows whether they are byte-identical.
What this tool implements
- What the comparison sees is measured, not assumed. On PDFs built to differ in one way each and run through the page in Chrome 156 on 2026-11-02, with pdf.js 4.10: changed text, white-on-white text, form-field values and sticky-note comments were shown; a scanned page and an image-only file could not be compared and the result says so by page number; images, fonts and position are not seen.
- pdf.js does not return form values or comments from getTextContent(): two forms reading SGD 10,000 and SGD 90,000 extracted identical text. They come from getAnnotations() and enter the comparison as labelled lines. Signature fields are left out, because their value is an object rather than text.
- A "no differences" result only ever means no differences in what was compared. SHA-256 of both files, computed in the browser, separates "identical byte for byte" from "the text matches but the files differ". Pages with no text are checked for image operators, so a blank page is not reported as a scan. A page mixing text and a scanned image counts as a text page, and the page says so.
- Until 2026-09-30 the page filled a full (M+1)×(N+1) LCS table. A Myers diff replaced it and matches an LCS oracle on 300 random pairs.
- Corrected 2026-11-02: "Diff complete" in green on files with no text; form-field values not compared; "zero outbound traffic" (the page loads site scripts and, with consent, ads); two separate tables whose rows drifted apart when a line wrapped, so "unchanged lines align" was false; a stale result left on screen after replacing a file; raw pdf.js text for a password error. Removed as padding: a dated changelog in the prose, and ten fact cards on the history of diff.
Sources
- Myers EW. An O(ND) Difference Algorithm and Its Variations. Algorithmica 1 (1986), 251-266.
- Free Software Foundation. GNU Diffutils manual — Overview: the basic algorithm of diff. https://www.gnu.org/software/diffutils/manual/html_node/Overview.…
- Git project. git diff options, --diff-algorithm: myers is "the basic greedy diff algorithm" and the default. https://git-scm.com/docs/diff-options
- Mozilla. PDF.js, src/display/api.js — PDFPageProxy getTextContent(), getAnnotations() and getOperatorList(). https://raw.githubusercontent.com/mozilla/pdf.js/master/src/displ…
- ISO 32000-1:2008, Document management — Portable document format — Part 1: PDF 1.7, section 12.5 (annotations) and 12.7 (interactive forms).
What can make this go out of date
- None at runtime: both PDFs are read and compared in your browser, and neither is uploaded to RECATOOLS or anyone else.