How to Compare Two PDF Versions and Spot Unauthorized Changes

To compare two PDF versions reliably, use several methods in order: file hashes to learn whether the bytes differ at all, then a visual comparison of the pages, a text comparison, a metadata inspection and a signature check. Each method catches changes the others miss. A short written routine with a recorded outcome is more dependable than trusting any single tool.
Compare PDF editors and document review tools on SecureTools.
Why Small PDF Changes Slip Through
A revised contract arrives with a friendly note saying only a typo was fixed. The file looks the same, the page count matches and the name ends in final. Yet a payment date, a liability cap or a party name may have changed, and nobody notices because reading a long document twice is exactly what busy people skip.
PDF files make this harder than word-processing files because there is usually no tracked-changes layer to read. What you have is a finished rendering plus a lot of structure behind it, and changes can hide in either place. Some are visible only on the page, some only in the extracted text, and some only in the file's metadata or its history of saves.
This guide gives you a six-step routine that layers different methods so a change that escapes one is likely to be caught by another. It pairs naturally with document version control for non-technical teams, which covers how to prevent the wrong version circulating in the first place.
Decide What Kind of Change You Are Hunting
Different worries call for different methods, so name the risk before you pick a tool. The checks you run for a harmless layout refresh are not the checks you run when you suspect someone altered an approved agreement.

- Content changes: altered wording, numbers, dates, names or clauses.
- Layout changes: moved sections, different fonts or page breaks, which can matter when page references are cited.
- Hidden changes: different metadata, extra attachments, comments or invisible text.
- Tampering after approval: edits made after a document was signed or formally approved.
For routine drafts, a visual and text comparison may be enough. For anything that carries legal, financial or regulatory weight, run the full routine and keep the record described later in this guide.
Step One: Confirm Which Two Files You Have
Comparison only helps if you are comparing the right pair. Record where each file came from, when you received it and who sent it, and save both as read-only originals in a working folder. Avoid opening either file in an editor and saving it, because many editors rewrite the file on save and that alone can change its bytes.
- Name the files with their source and date, for example the sender and the receipt date, not just a version number.
- Keep the original copies untouched and work on duplicates.
- Note the channel each came through, since a file from the counterparty's official portal deserves different trust than one forwarded by a third party.
- Check that you are comparing like with like: both final, or both drafts.
Good naming habits make this step quick, and the conventions in file naming and metadata standards are written with exactly this kind of review in mind.
Step Two: Compare File Fingerprints First
A cryptographic hash is a short fingerprint calculated from a file's contents. The NIST Secure Hash Standard, FIPS 180-4, describes hash algorithms that produce message digests, and the page notes that these digests are used for integrity checking because they reveal whether a message has been altered since its digest was created.
In practice you calculate the digest of each file and compare the two results. On macOS and Linux the command shasum with the argument -a 256 followed by the file name does this, and in Windows PowerShell the Get-FileHash command with the SHA256 algorithm does the same. If the digests match, the files are byte-for-byte identical and you can stop. If they differ, the files are not identical, but the digest cannot say how.
Treat a difference as a prompt for the next steps, not as proof of tampering. Re-saving a file, optimizing it, adding a bookmark or changing a metadata field all change the digest even when the visible pages are the same.
A matching digest is also useful in the other direction. When a counterparty publishes the digest of the approved version through a separate channel, you can confirm that the copy you hold is the one they meant.
Step Three: Compare the Visible Pages
A visual comparison overlays or aligns the rendered pages and highlights where they differ. It catches changed numbers, moved text and swapped images, which is what a human reader would see.

The open-source tool diff-pdf is a useful example of how this works. According to its project page it is a simple tool for visually comparing two PDF files. By default it prints nothing and returns a code of zero when there are no differences and one when the files differ, and an option can write a PDF that highlights the differences, while another opens a viewer where you can zoom in. The author notes the project is provided as is and is not actively developed, and it needs supporting libraries, so it suits technical users more than casual ones.
Many PDF editors include a compare feature as well. Whatever you use, test it on a pair of files where you know the changes. Tools that compare rendered pixels can flag harmless rendering differences, while text-only tools can miss changes in images or layout, so know which kind you have.
Step Four: Compare the Extracted Text
Extract the text from both files into plain text and run an ordinary text comparison. This is the strongest method for catching small wording and number changes, because a diff shows each altered word on its own line instead of leaving you to spot it by eye.
It also reveals content the page does not show. Text can be present in the file yet invisible to a reader, for example set in a color that matches the background or placed outside the visible page area. A visual comparison sees nothing, but the extracted text shows the difference.
- Compare at word level so one changed figure does not hide among reflowed lines.
- Normalize whitespace first, since reflowed paragraphs create noise.
- For scanned documents, remember the text comes from character recognition, so small differences can be recognition errors rather than real edits.
- Check that the reading order is sensible, because some files extract columns or footnotes in a scrambled sequence.
Keep a copy of both extractions with your review notes so the comparison can be repeated.
Step Five: Inspect Metadata and File History
Metadata can show that a file was produced by a different tool, at a different time or by a different author than you expected. The ExifTool PDF reference lists the standard document information fields: author, creator, producer, creation date, modification date, subject, title and keywords, along with an XMP section.
Compare these fields between the two files. A producer name that changed from a desktop application to an online converter, or a modification date later than the approval date, is worth a question to the sender.
The ExifTool page also notes that when metadata is written as an incremental update, the old values remain in the file, which it calls a potential security problem, and that a rebuild is needed to remove them permanently. For a reviewer this is useful in a second way: a file that has been saved many times by appending changes carries more history than the visible page suggests, and a forensic tool may show earlier values.
If your own team will send the file onward, see the metadata guidance in how to choose a PDF editor for confidential documents.
Step Six: Check Signatures and Changes After Signing
If the document carries a digital signature, the signature itself is evidence about changes. A PDF toolkit vendor explains that a signature covers a fixed part of the file, that changes made after signing usually make it invalid, and that PDFs permit a few edits to be appended without disturbing the signed bytes.

The same guide lists what can be appended by default when incremental saving is enabled: long-term validation data or a timestamp, form fields being filled in, and another signature. It also describes a property that returns true when a document was modified after signing, and it says this is true whether or not the change was one of the permitted actions. In other words, a signature that still validates can sit on a file that has grown since it was signed, and the signature then covers only part of the file.
So do not stop at a green tick. Look at what the viewer says about the signature, check whether the document was changed after signing, and compare any added content against what you expected. The walkthrough in how to verify a signed PDF is authentic covers certificates and validation messages in more depth.
Which Method Catches What
No single method covers everything, which is why the routine layers them. Use this table to decide how far to go for a given document.
| Method | Catches | Can miss |
|---|---|---|
| Hash comparison | Any byte-level difference between files | What changed, and whether the change matters |
| Visual page comparison | Changed numbers, moved text, swapped images | Invisible text, metadata and hidden history |
| Extracted text comparison | Small wording changes and hidden text | Image and layout changes, and scan recognition errors |
| Metadata inspection | Different producer, author or dates | Content changes that leave metadata alone |
| Signature and modification check | Edits after signing and appended content | Anything in an unsigned document |
For a draft that will be revised again, the visual and text steps are usually enough. For an executed agreement, a payment instruction or a regulatory filing, run all five and record the result.
Compare Numbers, Tables and Footnotes Carefully
Automated comparisons are good at spotting that something changed and weaker at telling you why it matters, so add a human check where the stakes are highest. Concentrate on the parts of a document where small edits do the most damage.
- Amounts, percentages and dates, including those inside tables and footnotes.
- Defined terms and party names, which can be altered in a single place and flow through the whole document.
- Headers, footers and page numbers, which affect clause references.
- Schedules, annexes and attachments, which are easy to replace without touching the main text.
- Anything that references another document by name or version.
For financial tables, copy the figures into a spreadsheet from both versions and compare them side by side. For a long contract, have two people read the changed passages independently. The principle is the same as in how to share a financial model with investors securely: decide in advance which numbers must not change and verify exactly those.
Record the Review for Audit
A comparison you cannot show later is worth much less than one you can. Keep a short record with the final approved file so anyone can see what was checked, by whom and with what result.
- Reviewer name and the date and time of the review.
- File names, sources and hash values for both versions.
- Methods used and the tools with their versions.
- Findings, each marked as accepted, rejected or queried with the sender.
- The decision and the name of whoever approved it.
Store the record next to the document. If your team already keeps transfer records, the thinking in secure file transfer audit logs applies, and electronic signature audit trails shows what a good signing record contains.
Build a Repeatable Review Routine
A routine only works if people actually follow it, so keep it short and tie it to events that already happen.
- Trigger the routine at three moments: before a document goes outside the company, before it is signed and whenever a counterparty returns an edited version.
- Assign an owner for each document type so it is clear who runs the checks.
- Run the hash check first and stop if the files are identical.
- Run the visual and text comparisons, then the metadata and signature checks for documents above your sensitivity threshold.
- Log the outcome and attach the record to the file.
- Escalate any unexplained difference to a second reviewer before the document moves on.
Review the routine every few months with a test pair of files containing known changes. If the routine misses a planted change, adjust it.
Mistakes That Lead to Missed Changes
Most missed changes come from process shortcuts, not from missing tools. Watch for these.
- Comparing a file against itself after it was opened and re-saved by an editor.
- Relying on the file name or a note from the sender to describe what changed.
- Using only a visual comparison on a document with suspected hidden content.
- Treating a valid signature indicator as proof that nothing changed since signing.
- Skipping the record, so no one can later show what was checked.
- Trusting a single tool without testing it on a pair of files with known differences.
None of these are exotic. A short checklist taped next to the review desk, or built into your document approval step, removes most of them.
Frequently Asked Questions
Yes, to a useful degree. You can calculate file hashes with built-in commands, extract text with a standard viewer and compare it using an ordinary text diff, and view metadata in the file properties. A dedicated visual comparison tool adds page-level highlighting, but the free steps already catch many changes.
Sources and Further Reading
This guide draws on the pages below. Vendor documentation and standards change, so check the current version before relying on a detail.
- diff-pdf Project Page on GitHub (github.com)
- NIST FIPS 180-4 Secure Hash Standard (csrc.nist.gov)
- ExifTool PDF Tags Reference (exiftool.org)
- Nutrient Guide: Document Modified Since Signature (nutrient.io)
Related Articles

About the Author: Mohamed Siraj
Mohamed is the founder of SecureTools.live. He leads the team in building secure, compliant, and privacy-first directory tooling for software teams, finance professionals, and enterprise security leaders worldwide.