PDF Guides

How to Check a File's Hash (SHA-256, MD5) and Compare Two PDFs

What file hashes are, how to check a download against a published SHA-256 or MD5 value, compare two PDFs byte by byte and spot later saved versions.

Saizul Amin
Saizul Amin28 Oct 2026 · 4 min read
How to Check a File's Hash (SHA-256, MD5) and Compare Two PDFs

How to Check a File's Hash and Compare Two PDFs

A hash is a fixed-length fingerprint worked out from every byte of a file. The same file always gives the same hash; change a single bit and the hash looks completely different. That makes hashes a simple, powerful way to answer "is this exactly the same file?" The free PDF Integrity and Hash Checker calculates them in your browser for PDFs and any other file, checks them against a value you were given and compares files with each other.

Where you meet hashes

  • Downloads: software publishers, open data portals and government sites often list a SHA-256 value next to a file so you can confirm it arrived intact.
  • Evidence and audit: investigators, lawyers and auditors record the hash of a document when they receive it, so they can later show it was not altered.
  • Archives: long-term storage systems re-check hashes to detect silent corruption on disks.
  • Teams: two people with "the final version" can compare hashes instead of reading 80 pages side by side.

Which algorithm

  • SHA-256 is the standard choice today, defined by NIST in FIPS 180-4.
  • SHA-512 is longer and equally strong.
  • SHA-1 and MD5 are older. They still detect accidental damage well, and many sites still publish them, but researchers can create two different files with the same MD5 or SHA-1. Do not rely on them where someone might tamper on purpose.

Checking a published hash

  1. Load the file you downloaded.
  2. Paste the published value into the expected hash box. Spaces, colons and capital letters do not matter.
  3. Press Check. The report says whether any loaded file matches.

If nothing matches, the download may be incomplete or damaged, you may have a different version, or the file may have been replaced. Download it again from the official source before you open it.

Comparing PDFs

Load two or more files and each is compared with the first. You will see one of three results:

  • Identical: byte for byte the same.
  • The other file plus extra bytes: one file contains the whole of the other and then more. With PDFs this usually means a later saved version: the document was signed, filled in or annotated and saved by appending.
  • Different from byte N: the files diverge at that position. Even re-saving a PDF without visible changes rewrites it, so different bytes do not always mean different content.

The report also shows the document ID that most PDF software keeps across edits; when two different files share an ID, they are probably versions of the same document.

PDF details at a glance

For each PDF you also get the version from the header, the number of saved versions inside it, how many signatures it holds and whether it is encrypted. More than one saved version means the earlier ones can be recovered, which our PDF Revision Extractor does.

Keeping a checksum file

Download the results as a checksum file in the sha256sum format and keep it with your archive. Later you can check the files again here, or on Linux and macOS with the command sha256sum -c.

A quick worked example

Suppose a council publishes a planning decision with the SHA-256 value beginning 3f9a. You download the PDF, load it, paste the full value and press Check: the report says it matches, so your copy is the one the council published. A colleague emails you "the same" decision; you load both files. The second differs from byte 1,904,212 onward and is reported as the first file plus extra bytes, with one more saved version and one signature. Someone signed or annotated it after publication, which is worth knowing before you rely on it.

What a hash does not prove

A matching hash proves the bytes are identical. It does not show who made the file or whether its content is true. To prove authorship, use a digital signature. And because a hash only helps if the expected value is genuine, get that value from a trusted source, not from the same place as a suspicious file.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages