How to verify a downloaded file with SHA-256 or MD5
A checksum is a fingerprint of a file. Compare the fingerprint of your download with the one the publisher lists, and you know whether the file arrived intact, down to the last bit.
What a checksum proves
A hash function such as SHA-256 turns a file of any size into a fixed-length string of digits. The same file always gives the same checksum, and changing a single byte gives a completely different one. If your file's checksum matches the one the publisher lists, your copy is identical to the file they hashed: not truncated, not corrupted on the way, not a different version.
What it doesn't prove:
- That the file is safe. Malware has a checksum too. A match only says your file equals its source.
- That the source is genuine. If the download server is compromised, an attacker can replace the file and the checksum on the same page. That is why Ubuntu signs its checksum list:
SHA256SUMScomes withSHA256SUMS.gpg, checked withgpg --verify, and Node.js publishes a signedSHASUMS256.txt. - Authenticity, if the checksum is MD5 or SHA-1. For both, two different files with the same hash can be crafted on purpose. They still catch a broken download, but to be sure a file wasn't swapped deliberately, use SHA-256 or longer.
When it is worth checking
- Firmware for a router, printer or other device. A corrupted firmware file can leave a device unable to boot after flashing, and that is hard to fix at home.
- Operating system installers. A damaged ISO often fails halfway through the install. Check it before writing it to a USB stick; that takes less time than a second install.
- Apps from outside an app store. If the developer lists a SHA-256 on their official site, match it before installing.
- Backups. To confirm a copy on an external drive equals the original, hash both. Names and dates may differ; the checksum depends only on the content.
Where publishers list checksums
Look for "SHA256", "checksum" or "hash" near the download button. Larger projects put them in a separate file: SHA256SUMS (Ubuntu), SHASUMS256.txt (Node.js), or a .sha256 file next to the download. Each line reads checksum file-name. Since June 2025, GitHub release pages show a SHA-256 next to every asset. GitHub computes it at upload and it can't be changed afterwards, so it is useful even for projects that don't publish checksums themselves.
Built-in commands
| System | SHA-256 | MD5 |
|---|---|---|
| Windows PowerShell | Get-FileHash file.iso | -Algorithm MD5 |
| Windows Command Prompt | certutil -hashfile file.iso SHA256 | use MD5 |
| macOS | shasum -a 256 file.iso | md5 file.iso |
| Linux | sha256sum file.iso | md5sum file.iso |
Windows
Get-FileHash uses SHA-256 when no algorithm is given, and also accepts SHA1, SHA384, SHA512 and MD5. It prints the hash in uppercase. To compare without reading 64 characters by eye:
$h = (Get-FileHash .\installer.iso).Hash
$h -eq 'paste-the-published-checksum'
PowerShell answers True or False. The -eq operator ignores case, so a lowercase checksum from the website still matches. In Command Prompt, always put the algorithm name at the end of the certutil command.
macOS and Linux
If the publisher provides a checksum list, let the computer do the comparison. Save the list in the same folder as the download, then run:
# Linux
sha256sum -c SHA256SUMS --ignore-missing
# macOS
grep installer.iso SHA256SUMS \
| shasum -a 256 -c
A good result reads installer.iso: OK. The --ignore-missing option skips lines for files you didn't download; on macOS, grep passes just the one line.
Checking in the browser
On a phone, or on a work computer where you can't open a terminal, the browser can compute the checksum. The file is read on your device and not uploaded.
- Open the Hash Generator & Checksum Checker and choose File.
- Drop the file on the box, or press Choose files. The read progress shows under the file name.
- For a large file, untick the algorithms you don't need and keep the one the publisher used, usually SHA-256. The choice is remembered for your next visit.
- Paste the published checksum into Compare with checksum. The algorithm is recognized from the length: 32 hex characters for MD5, 40 for SHA-1, 64 for SHA-256. A whole line from a checksum list, such as
checksum file-nameorSHA256 (file-name) = checksum, works too. - The matching row gets a match label, and the line under the field reads "Match. The SHA-256 is identical to the expected checksum."
MD5 is computed in 8 MB pieces, so file size is practically unlimited. SHA runs in Web Crypto, which needs the whole file in memory; a multi-gigabyte ISO can fail on a phone with little RAM, and the tool tells you when that happens.
When the checksum doesn't match
- An incomplete or damaged download. Compare the file size with the size on the site, then download again, preferably on a stable connection.
- A different file. Other versions, editions or architectures, such as
amd64andarm64, each have their own checksum. Make sure the line you copied is for your exact file name. - A checksum cut short when copying. The tool tells you how many digits you pasted, for example 63, when a SHA-256 always has 64.
If a fresh download still doesn't match and it came from a mirror, get the file from the publisher's own site. Don't install a file whose checksum doesn't match.
Questions
If the checksum matches, is the file virus-free?
The site only lists an MD5. Is that enough?
Why is the Windows result uppercase when the site shows lowercase?
-eq and the compare field in the Hash Generator both treat them as a match.