To verify a file checksum, calculate the file's SHA-256 hash on your computer and compare it with the value the publisher lists next to the download. If every character matches, the file is the one they published. If even one differs, delete it and download it again.
Each system has a built-in command for this, so you don't need to install anything. The harder part is knowing which published value to compare against, and what a match does and doesn't prove.
What a checksum is
A checksum, or hash, is a short fingerprint calculated from every byte of a file. The same file always gives the same hash. Change one bit, and the hash looks completely different. That makes it a quick way to confirm two files are identical without comparing them byte by byte.
Publishers list the hash of the file they built. You calculate the hash of the file you received. Equal values mean nothing changed on the way: no corrupted download, no truncated transfer, no swapped file on a mirror.
Most publishers use SHA-256, a 64-character string of digits and the letters a to f. You'll sometimes see SHA-512 (128 characters) and, on older sites, SHA-1 or MD5. Use the strongest one the publisher offers; SHA-1 and MD5 still catch accidental damage but can no longer be trusted against deliberate tampering.
How to check a checksum on each system
Open a terminal in the folder that holds the download, run the command for your system, and compare the output with the published value.
| System | Command | Notes |
|---|---|---|
| Windows PowerShell | Get-FileHash file -Algorithm SHA256 |
Output is uppercase; case doesn't matter |
| Windows Command Prompt | certutil -hashfile file SHA256 |
Works on older Windows too |
| macOS | shasum -a 256 file |
Use -a 512 for SHA-512 |
| Linux | sha256sum file |
sha512sum for SHA-512 |
1. Windows
In File Explorer, open the Downloads folder, type powershell in the address bar and press Enter. Then run:
Get-FileHash .\setup.exe -Algorithm SHA256
The Hash column shows the result. PowerShell can also do the comparison for you, which avoids reading 64 characters by eye:
(Get-FileHash .\setup.exe -Algorithm SHA256).Hash -eq "paste-the-published-hash-here"
True means it matches. The comparison ignores upper and lower case, which is what you want, because hashes mean the same either way.
2. macOS
Open Terminal, type shasum -a 256 with a space at the end, drag the file into the window to fill in its path, and press Enter. The hash prints first, then the file name.
3. Linux
Run sha256sum with the file name. Many Linux downloads come with a file listing the hashes of every file in the release, often called SHA256SUMS. Put it next to the downloads and let the command check them all:
sha256sum -c SHA256SUMS --ignore-missing
Each file gets OK or FAILED. The --ignore-missing flag skips files on the list that you didn't download.
Compare against the right value
A mismatch is most often a wrong comparison, not a bad file. Before deleting anything, check these:
- Platform and architecture. Windows, Mac and Linux builds are different files, and so are x64 and ARM64 versions of each. Each has its own hash.
- Version. A page may list hashes for several releases. Match the version number in the file name.
- Algorithm. A SHA-512 value never matches a SHA-256 result. Count the characters: 64 for SHA-256, 128 for SHA-512.
- Copy errors. Copy the published value instead of retyping it, and watch for a trailing space or a line break.
If the values still differ, download the file again, preferably straight from the publisher instead of a mirror. A second mismatch on a fresh download is worth reporting to the publisher.
What a matching checksum proves
A match proves the file is byte for byte the file whose hash you compared against. It doesn't tell you who made that file.
That gap matters when the checksum and the file come from the same page. Someone who breaks into a download site can replace the installer and the hash listed next to it, and the two will still match. Checksums are excellent at catching damaged downloads and bad mirrors, and weak against a compromised publisher site.
Two things close the gap:
- Get the hash from a second place. Some projects post hashes in their release notes, their code repository or an announcement as well as on the download page. Both copies agreeing makes a quiet swap much harder.
- Check the signature when there is one. Signed releases come with a signature file made with the author's private key. Verifying it, with GnuPG for example, proves the author produced the file, as long as you obtained their public key from a source you trust. The GnuPG integrity check guide shows the steps. Windows and Mac installers often carry a code-signing certificate instead, which the system checks and shows as the verified publisher when you open the file.
Frequently asked questions
Is MD5 still OK for checking downloads?
For spotting a corrupted or incomplete download, yes: accidental damage still changes the MD5 value. It isn't safe against someone tampering on purpose, because attackers can create two different files with the same MD5. When a publisher offers SHA-256 as well, compare that one instead.
What should I do if the checksum doesn't match?
Don't open the file. First rule out a wrong comparison: platform, architecture, version and algorithm must all match. Then delete the file and download it again from the publisher's own site. If a fresh copy still fails, tell the publisher, since their listed hash or the file itself may be wrong.
Do app stores and package managers check this for me?
Yes. App stores and system package managers verify signatures or hashes on every install and refuse files that fail. Manual checking matters for software you download yourself from a website, such as installers, disk images and firmware files.
Can I check a checksum without the terminal?
Yes. A browser tool that hashes the file locally works the same way, as long as it calculates the hash on your device and doesn't upload the file. That matters for large files and for anything private.
Check a file in your browser
Drop the file into the file checksum tool and paste the published value. It calculates SHA-256, SHA-512 and SHA-1 on your device, tells you whether the hash matches, and never uploads the file. For hashing text rather than files, use the hash generator.