How to verify a download's checksum

Windows, macOS, Linux and in the browser, plus what a matching checksum actually proves.

Software sites often publish a checksum next to the download: a short string such as a SHA-256 hash. If your copy produces the same string, the file is byte-for-byte what the publisher listed. If even one byte differs, the string comes out completely different.

1. Find the published checksum

Look on the download page, or for a file named something like SHA256SUMS or file.iso.sha256. Use SHA-256 if there is a choice. Copy the value for the exact file you downloaded; a release page often lists many files.

2. Compute the checksum of your file

Use whichever is nearest to hand. Replace file.iso with your filename.

Windows (PowerShell)

Get-FileHash .\file.iso -Algorithm SHA256

Windows (Command Prompt)

certutil -hashfile file.iso SHA256

macOS

shasum -a 256 file.iso

Linux

sha256sum file.iso

In the browser: drop the file into the File Hash Checker. It reads the file locally and never uploads it, which matters if the download is large or private.

3. Compare the two strings

Compare the whole string, not the first and last few characters. Case does not matter (ABC and abc are the same hash). To avoid eyeballing 64 characters, paste the published value into the Hash Comparator, which tells you whether they match.

If the publisher gives a checksum file, the command line can do the comparison for you:

sha256sum -c SHA256SUMS

On macOS, use shasum -a 256 -c SHA256SUMS. It prints OK next to each file that matches.

What a match proves, and what it doesn’t

  • It proves your download is complete and was not corrupted in transit.
  • It does not prove the file is safe. If an attacker replaced the file on a compromised website, they could replace the checksum on the same page too.
  • For stronger assurance, get the checksum from a different source than the file, or check the publisher’s cryptographic signature when they provide one.

Which algorithm?

Use SHA-256 or stronger. MD5 and SHA-1 are fine for spotting accidental corruption, but they are broken against someone deliberately crafting a colliding file, so they are weak evidence of authenticity. The SHA-256 vs MD5 guide goes into the detail.

If the checksums don’t match

Download the file again, ideally over a different connection, and compare once more. Check you are comparing against the right file and the right algorithm. If it still differs, do not run it. Get it from the official source.