How to Verify a Download With a Checksum, Step by Step
A checksum proves your file arrived intact and unchanged. Here is how to check a SHA-256 hash on Windows, macOS and Linux.
You have downloaded a large installer, and the developer's page lists a long string of letters and numbers next to it. That string is a checksum, and it gives you a way to confirm that your copy is exactly the file the developer published. It takes a couple of minutes and is one of the most useful habits in safe downloading.
What a checksum is
A checksum, also called a hash, is a short fingerprint calculated from the contents of a file. Change even a single byte and the fingerprint changes completely. SHA-256 is a common algorithm for this, producing a string of 64 characters made of the digits 0-9 and the letters a-f.
If the fingerprint of your download matches the one the developer published, the file is the same one they made.
What a checksum can and cannot tell you
It helps to be realistic about what you learn from this check.
- It can show corruption. A match means the file was not damaged during the transfer.
- It can show tampering in transit, as long as the checksum came from a trustworthy place.
- It cannot prove the file is harmless. If an attacker controls the page, they can publish a matching checksum for a bad file.
That is why the checksum should come from the developer's official site, ideally over a secure connection, and not from the same untrusted page that gave you the download.
Checking on Windows
Open PowerShell, which you can find through the Start menu. Then run a command like this, replacing the path with your own file:
Get-FileHash C:\Users\YourName\Downloads\setup.exe -Algorithm SHA256
The result includes a Hash value. Another option is the Command Prompt command certutil -hashfile followed by the file path and the word SHA256.
Checking on macOS
Open Terminal and run the following, with your own file name:
shasum -a 256 ~/Downloads/file.dmg
The long string at the start of the output is the checksum.
Checking on Linux
In a terminal, run:
sha256sum ~/Downloads/file.iso
Some projects also provide a file with a list of checksums, and sha256sum can compare against it directly using its check option.
Comparing the two values
Place the published value and your result side by side. Look at the first and last several characters, and then check the middle. Better still, paste both into a text editor, or use the compare option built into your command line tool, because tired eyes miss differences. They must match exactly, though capital and lowercase letters are treated as the same in this kind of hash.
If the values do not match
Do not install or open the file. Try these steps:
- Delete the file and download it again, ideally on a stable connection.
- Compare again. A single failed transfer is the most common reason for a mismatch.
- If it still differs, check that you are looking at the checksum for the same version and the same file type.
- If the problem persists, get the file from another official source, and tell the developer.
When it matters most
Checksums are most worthwhile for large or sensitive downloads, such as operating system images, security tools and installers for software that runs with high privileges. For a small, well-known app from an official store, the store itself does the verification for you. For more on judging sources in general, read our guide on how to tell if a download site is trustworthy.
Frequently asked questions
Is MD5 good enough? MD5 is fine for spotting accidental corruption but is not considered secure against deliberate tampering. SHA-256 is the better choice when it is offered.
Why is my checksum different when the download looks fine? The file may be incomplete, a different version, or a different edition from the one the checksum describes.
Do I need to do this for every download? No. Save it for important or large files, or when the developer recommends it.
Steps
- Find the published checksum: Look on the developer's official download page for a SHA-256 value next to the file.
- Calculate your file's checksum: Use your system's built-in command to compute the SHA-256 hash of the file you downloaded.
- Compare the two values: Check that every character matches exactly; any difference means you should not use the file.