Skip to content
toolsdocks

Verifying a download with SHA-256

8 min read · Updated 23 October 2026

How do you verify a download with a checksum? Compute the file's hash on your own device, then compare it with the value the publisher lists on its official site. If the two strings are identical, your copy is byte for byte the same as the file the publisher hashed. The checksum verifier does both steps in the browser, using the file on your device.

A checksum (also called a hash or digest) is a short fingerprint of a file's exact contents. Publishers of operating system images, installers, firmware and large archives often print one next to the download link. It looks like this:

ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

That is the SHA-256 hash of the three-letter text abc. For a given algorithm, every file of any size produces a hash of the same length. If even one bit of your copy differs, the hash is completely different. This guide explains how to check one on every major device, what a match does and does not prove, and which algorithms you can still trust.

How a checksum works

A hash function reads every byte of a file and boils it down to a fixed-length number, usually shown as hexadecimal digits (0 to 9 and a to f). Three properties make it useful:

  • Same input, same output. The same file gives the same hash on any computer.
  • Tiny change, huge difference. The text abc hashes to ba7816bf... and the text abd hashes to a52d159f.... Nothing about the first hash hints that the inputs were nearly identical.
  • One way. You cannot rebuild a file from its hash. For a modern algorithm there is no practical way to craft a different file with the same hash.

The file name, date and folder are not part of the hash. Only the bytes inside count. Renaming setup.exe to setup (1).exe does not change it. Even an empty file has a hash: for SHA-256 it is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. If you ever see that value, your download is empty, which usually means it failed.

How to check a file, step by step

  1. Find the official checksum. Look on the publisher's own download page, over HTTPS. Many projects publish a file named SHA256SUMS that lists one hash per file. Pick the line for the exact file you downloaded, including the right version and processor type (for example, a 64-bit Intel build versus an Apple silicon build).
  2. Compute the hash of your download. Use the browser tool or one of the command line options below.
  3. Compare the two strings. All characters must match. Capital and small letters do not matter, because hexadecimal is compared without regard to case.
  4. Act on the result. On a match, go ahead and install or open the file. On a mismatch, delete the file and download it again.

In the browser (any device)

Open the checksum verifier, choose your file, and paste the expected hash or add the SHA256SUMS file. It calculates MD5, SHA-1, SHA-256 and SHA-512 on your device and reports whether the result matches. This is the easiest route on an iPhone, iPad or Android phone, which have no built-in hash command.

On Windows 10 and 11

Open PowerShell and run:

Get-FileHash "$env:USERPROFILE\Downloads\installer.iso" -Algorithm SHA256

SHA-256 is the default, so the -Algorithm part is optional. The older Command Prompt route also works:

certutil -hashfile "C:\Users\You\Downloads\installer.iso" SHA256

On a Mac

Open Terminal and run:

shasum -a 256 ~/Downloads/installer.dmg

To avoid typing the path, type shasum -a 256 (with a trailing space) and drag the file from Finder into the Terminal window.

On Linux

sha256sum ~/Downloads/installer.iso

To check a file against a whole SHA256SUMS list, keep both in the same folder and run sha256sum -c SHA256SUMS --ignore-missing. A line ending in OK next to your file name is a match.

Which algorithm should you use?

Algorithm Output length Hex characters Status
MD5 128 bits 32 Broken for security; fine only to spot accidental damage
SHA-1 160 bits 40 Collisions were produced in practice in 2017 (the "SHAttered" attack); do not rely on it against tampering
SHA-256 256 bits 64 The usual choice; no practical collision attack is known
SHA-512 512 bits 128 Also sound; common for some Linux and server downloads

You can often tell the algorithm from the length of the string alone. A 64-character hash is almost certainly SHA-256.

A collision is two different files with the same hash. For MD5 and SHA-1, researchers can build collisions on purpose, which means an attacker could in theory prepare a harmful file that matches a trusted hash. NIST has announced a plan to retire SHA-1 by the end of 2030. If a publisher lists both SHA-256 and MD5, check the SHA-256 value.

Do not confuse these with CRC32, a very short checksum used in ZIP files and network equipment. It catches random errors, but it was never designed to stop deliberate changes.

What a match proves, and what it does not

A match proves your file is identical to the one the checksum was made from. It does not prove the file is safe, and it does not prove the checksum itself is genuine.

Think about where the checksum came from. If an attacker can alter a download page, they can alter both the file and the hash printed beside it. A match then only proves you received the attacker's file intact. So:

  • Copy the hash from the publisher's official site over HTTPS, not from a mirror, a forum post or a video description.
  • Prefer projects that sign their checksum file, for example with a GPG signature such as SHA256SUMS.gpg. A signature shows the list came from the project's key, so changing the web page is not enough to fool you.
  • Treat the checksum as one layer. Your operating system adds others, such as Windows SmartScreen and macOS Gatekeeper, which look at code signing on programs you open.

This guide is general education, not a complete security procedure. For high-risk software such as firmware, disk encryption tools or server images, follow the publisher's own verification instructions.

A worked example

Take the text file hello.txt that contains the five letters hello and nothing else (no trailing line break). Its hashes are:

Algorithm Hash
MD5 5d41402abc4b2a76b9719d911017c592
SHA-256 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Save the file, run the command for your system, and you should see exactly those values. Now add a line break at the end of the file and hash it again. The result is completely different, because the file is now six bytes, not five. This is the most common reason hashes of text files disagree between two people: an editor added or removed a final line break or changed the line endings. Hash files exactly as downloaded, never after opening and re-saving them.

For a real download, the same steps apply. The vendor lists a 64-character value beside installer.iso. You compute your own and compare the entire string. If the result looks different, the possible causes are:

  1. The download was cut short or damaged on the way.
  2. You downloaded a different version or architecture than the checksum describes.
  3. The file on disk was changed after download, for example by a failing drive.
  4. The file was tampered with before it reached you.

Delete the file, download it again (ideally on a different connection), and check again. If a fresh download from the official site still fails, do not install it, and tell the publisher.

Common mistakes

  • Hashing the wrong file. The checksum for an .iso does not apply to a .zip that contains it. Hash the exact file the publisher hashed.
  • Comparing different algorithms. A SHA-256 value never equals an MD5 or SHA-1 value for the same file. Check the algorithm name beside the checksum.
  • Comparing only the first few characters. It is quick, but it throws away most of the protection. Compare the whole string, or let a tool do it.
  • Pasting extra characters. A leading space, a file name copied from a SHA256SUMS line, or a line break can cause a false mismatch. Paste only the hash.
  • Assuming a mismatch means malware. Most mismatches are plain download errors. They are still a reason not to use the file.

Other uses for hashes

  • After you split a large file to fit an email or upload limit and join the parts again, compare the hash of the rebuilt file with the original to confirm nothing was lost. That tool can also verify the rejoined result against a SHA-256 checksum.
  • Finding duplicate files is the same idea in reverse: files with identical content have identical hashes, whatever their names.
  • When you copy photos or documents to a backup drive, hashing a few files on each side is a quick way to confirm the copy is exact.

FAQ

What is a checksum in plain terms? It is a short fingerprint calculated from every byte of a file. If the file changes in any way, the fingerprint changes. You compare your fingerprint with the publisher's to see whether your copy is identical.

Is MD5 safe for checking a download? It is fine for catching accidental damage, such as an interrupted download. It is not safe against someone who wants to swap in a harmful file, because MD5 collisions can be created on purpose. Use SHA-256 when the publisher offers it.

Why does my SHA-256 not match? The usual causes are an incomplete download, the wrong version or architecture, or a hash copied for a different file. Download again and compare the full 64 characters. If it still fails from the official site, do not run the file.

Do capital letters matter when I compare hashes? No. A hash is a number written in hexadecimal, so ABCDEF and abcdef are the same value. Spaces and line breaks do matter, so paste only the hash.

Can I check a checksum on my phone? Yes. Phones have no built-in command for it, but the checksum verifier runs in a mobile browser and reads the file on the device. For multi-gigabyte images, a computer is usually easier.

Does a matching checksum mean the file is free of viruses? No. It only means your copy equals the publisher's copy. If the publisher's file were harmful, yours would be too. Download from official sources and keep your operating system's security features turned on.