How to Verify File Integrity Using Checksums
Learn to verify file integrity with SHA-256 checksums. Step-by-step for Linux, macOS, and Windows using our free hash calculator to check downloads in browser.
Why Verify Downloads?
When you download a file, an operating system image, a software package, a PDF document, you want to know two things: the file arrived intact (no corruption during transfer), and it is the file you intended to download (no tampering). A checksum helps with the first. Combined with a trusted source, it helps with the second.
Corruption during download is more common than people think. Network interruptions, faulty RAM, buggy proxy servers, and even cosmic rays can flip bits in transit. TCP checksums catch some errors but not all. A cryptographic hash catches every single-bit change.
What a Checksum Is
A checksum is the output of running a file through a hash function. The most common format today is SHA-256, a 64-character hexadecimal string:
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 hello.txt
Software publishers publish checksums alongside downloads. You compute the checksum on your end and compare. If the two match, the file is bit-for-bit identical to what the publisher intended.
The standard format for checksum files is one line per file: hash, two spaces,
filename. If you see a file called SHA256SUMS at the download page, that is
what you are looking for.
Common Commands
Linux:
sha256sum downloaded-file.iso
macOS:
shasum -a 256 downloaded-file.iso
Windows (Command Prompt):
certutil -hashfile downloaded-file.iso SHA256
Windows (PowerShell):
Get-FileHash -Algorithm SHA256 downloaded-file.iso
All four produce the same 64-character hex string for the same file. The algorithm is deterministic. Any machine, any operating system, any implementation computes the same SHA-256 for the same bytes.
Verifying Against a Checksum File
When publishers provide a SHA256SUMS file, you can verify in a single step
instead of comparing manually:
sha256sum -c SHA256SUMS
The -c flag tells sha256sum to read expected hashes from the file, compute
the actual hash for each listed file, and report OK or FAILED. This is
faster and less error-prone than eyeballing two 64-character strings side by
side.
Step-by-Step: Compare Published Hash vs Computed Hash
- Go to the download page for the software you are installing.
- Locate the published SHA-256 checksum. Look for a file called
SHA256SUMSor a checksum listed directly on the download page. - Download the file to your machine.
- Download the checksum file to the same directory if one is provided.
- Open a terminal and run the appropriate command from above.
- Compare the output character by character against the published hash.
If they match, the file is intact. If even one character differs, the file is corrupt or has been modified. Do not run it. Delete it and download again from a different mirror if possible.
Verify in Your Browser
If you do not have a terminal handy, you can verify a checksum directly in your browser:
- Open the Hash Calculator.
- Switch to file input mode.
- Select the downloaded file.
- Choose SHA-256 from the algorithm dropdown.
- Compare the output to the published checksum.
The tool computes the hash entirely in your browser using the Web Crypto API. Your file is never uploaded to a server. For large files (multiple gigabytes), the browser handles streaming hashing efficiently without loading the entire file into memory at once.
MD5 and SHA-1: Legacy Algorithms
You may still see MD5 or SHA-1 checksums published for older software. Both are broken for security purposes but remain acceptable for detecting accidental corruption during download. If a publisher only offers MD5 checksums and you are downloading security-critical software (an OS installer, a password manager, a VPN client), that is a red flag. Modern projects use SHA-256 or SHA-512.
SHA-1 was deprecated for security use in 2017 after Google and CWI demonstrated the first practical collision (SHAttered). Like MD5, SHA-1 is fine for catching bit flips but useless against an attacker who can craft a malicious file to match a given SHA-1 hash.
Checksum Does Not Equal Authenticity
A checksum proves integrity, not authenticity:
- If an attacker can modify the file on the server, they can also modify the published checksum on the same page. Matching the checksum would only prove you downloaded the attacker's file.
- For authenticity, you need a digital signature, a checksum signed with the publisher's private key. GPG-signed checksum files are common for Linux distributions. The signature proves the checksum came from the key holder.
- Always get the checksum from a trusted source. Ideally a different domain or
channel than the download itself. If you download the ISO from
mirror.example.combut verify against the checksum published on the project's official website, a compromise of the mirror cannot fool you.
Try it yourself: open the Hash Calculator, type
hellointo the text input, and compute the SHA-256 hash. The result should be2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. This is the same digest every SHA-256 implementation anywhere produces for the same input. Then switch to file mode, select any file on your computer, and verify you get a 64-character hex string. Change a single byte in a text file, re-hash it, and observe that the digest is entirely different.