Next to many downloads, especially Linux ISOs, developer tools, firmware and crypto wallets, you'll see a long string labelled "SHA-256" or "checksum". Most people scroll past it. It takes about a minute to use, and it's the simplest way to be sure the file you downloaded is exactly the file the publisher released.
What a checksum proves
A SHA-256 hash is a 64-character fingerprint calculated from every byte of a file. Change one bit anywhere in the file and the fingerprint changes completely. If the hash of your download matches the one the publisher lists, you have the same file, byte for byte.
That protects against two things:
- Corruption: a download that was cut short, a flaky connection, a bad USB stick or a failing disk.
- Tampering: a compromised mirror or download server serving a modified installer.
One important limit: if an attacker controls the website that shows both the download and the checksum, they can change both. Checksums are strongest when published somewhere separate, for example on the main site while the file comes from a mirror, or in a release announcement. The really strong version is a GPG or Sigstore signature over the checksum file, which proves who published it.
How to check, step by step
In your browser
- Open the Hash Generator and switch to the File tab.
- Select the downloaded file. It's hashed on your device and never uploaded, so this works for large and private files.
- Compare the SHA-256 result with the published value.
Windows (PowerShell)
Get-FileHash .\ubuntu-24.04-desktop-amd64.iso -Algorithm SHA256Or in the classic command prompt: certutil -hashfile file.iso SHA256. Both are built in.
macOS
shasum -a 256 ~/Downloads/file.dmgLinux
sha256sum file.isoMany projects publish a SHA256SUMS file listing every download. Put it in the same folder and let the tool do the comparison:
sha256sum --check --ignore-missing SHA256SUMS
# file.iso: OKComparing the result
Hashes are hard to compare by eye, and checking only the first and last few characters isn't enough against a deliberate attack. Better options:
- Paste both hashes into a text editor on consecutive lines and use its search: search for the full expected hash and see whether it's found twice.
- In PowerShell:
(Get-FileHash file.iso).Hash -eq "EXPECTEDHASH"printsTrueorFalse. - Use
sha256sum --checkas above, which does the comparison itself.
Case doesn't matter: A1B2… and a1b2… are the same hash. Windows tends to print uppercase, other systems lowercase.
If the hash doesn't match
- Make sure you're comparing the right algorithm. An MD5 (32 characters) will never match a SHA-256 (64 characters).
- Check you hashed the right file and version. Releases often have several similar file names.
- Download again, ideally from the official source rather than a mirror.
- If it still doesn't match, don't run the file. Report it to the publisher.
What about MD5 and SHA-1?
Both are broken for security purposes: researchers can create two different files with the same MD5 in seconds, and the first practical SHA-1 collision was published in 2017. For detecting accidentalcorruption, they still work fine, which is why you'll see them in older download pages and backup tools. When you have a choice, use SHA-256. SHA-512 is equally good and sometimes faster on 64-bit machines.
Checking text, not files
If you hash a short string in a terminal and get a different result from a website, the usual culprit is an invisible newline. echo "hello" | sha256sum hashes hello\n. Use printf '%s' "hello" or echo -n instead. Windows line endings (\r\n) and different text encodings cause the same kind of mismatch.