How to Verify a SHA-256 Checksum of a Downloaded File

PublishedToolFile Hash (Checksum) Generator

Contents
  1. Why bother comparing checksums at all
  2. Read the distributor's value correctly first
  3. How to get a SHA-256 value without any tools
  4. What a checksum guarantees and what it doesn't
  5. What to check, in order, when you get a mismatch
  6. Reproduce it yourself
  7. Summary
  8. Frequently asked questions

This post is for anyone who downloaded an installer or ISO image, saw a string like SHA256: 9b3ebd… on the release page, and got stuck on how to match it against their file. The short answer: one command already built into your operating system computes the same value, and you just compare the two strings.

But there is one more thing to know. A checksum only tells you that "my file is byte-for-byte identical to the file that produced this value" — nothing more.

Summary ① On Windows use certutil -hashfile, on macOS use shasum -a 256, and on Linux use sha256sum to get the value. ② A SHA-256 value is always 64 hexadecimal characters. If the length is different, you are using the wrong algorithm. ③ A match means "this is the same file the checksum was made from," not "this file is safe."

Why bother comparing checksums at all

Almost all downloads today use HTTPS, so content silently changing in transit is already blocked. Even so, distributors still publish checksums alongside their files, and there is a reason.

Transmission is not the only path by which a file can differ from the original. You might have downloaded from a mirror server instead of the official one, a resumed download might have been cut off halfway, or a few sectors could be damaged while copying to a USB drive or external disk.

Differences like these do not show up if you only look at file size. It is entirely possible for a file to extract and even run while one file inside it is corrupted.

Read the distributor's value correctly first

Before you start comparing, check which algorithm the value belongs to. Release pages label it as SHA256SUMS, checksums.txt, SHA-256:, or something similar.

If the label is missing or unclear, you can identify it by length. Every hash algorithm has a fixed output length.

AlgorithmOutput lengthHexadecimal characters
SHA-1160 bits40
SHA-256256 bits64
SHA-384384 bits96
SHA-512512 bits128

If you downloaded a file like SHA256SUMS, each line is written as <hash value> <space> <filename>. Some distributors put a * before the filename, but that only marks it as having been read in binary mode and does not affect the value.

Only the hash value at the front is what you compare.

How to get a SHA-256 value without any tools

The command is already on your operating system. No extra installation needed.

Windows

Use one of the following in Command Prompt or PowerShell.

certutil -hashfile "C:\Users\me\Downloads\setup.zip" SHA256
Get-FileHash "C:\Users\me\Downloads\setup.zip" -Algorithm SHA256

certutil prints explanatory text above and below the hash, so just look at the middle line of hexadecimal. PowerShell's Get-FileHash outputs the value in uppercase, but hexadecimal is the same value regardless of case, so you can compare it as is.

macOS and Linux

In the terminal, just add the file path.

shasum -a 256 setup.zip     # macOS and Linux
sha256sum setup.zip         # Linux

The number after -a is the algorithm. Change it to -a 1, -a 384, or -a 512 to get SHA-1, SHA-384, or SHA-512 values respectively. The output looks like <hash value> <filename>.

If the distributor also provides a SHA256SUMS file, you can let the command do the comparison for you. Run the following in the same folder as the file, and it prints OK or FAILED for each filename.

shasum -a 256 -c SHA256SUMS
sha256sum -c SHA256SUMS      # Linux

When comparing by hand

If there is no checksum file, you eventually have to match two 64-character strings with your own eyes. The most common mistake is getting in the habit of checking only the first 6 and last 6 characters and calling it done.

Another frequent snag is paste contamination. Copying a value from a web page brings along leading or trailing whitespace or line breaks, and copying the entire shasum output drags the filename in with it.

Checking with our tool. Pick an algorithm, add a file, then paste the distributor's value into the field below, and it tells you whether they match by color.

File Hash (Checksum) Generator

Computes SHA-256, SHA-384, SHA-512, and SHA-1 right in your browser, and the files you add are never sent to a server.

The layout is simple. In the File / Text tabs at the top, choose your target, then select one of SHA-256, SHA-384, SHA-512, or SHA-1 from the Hash algorithm list.

The computed value appears in the "SHA-256 checksum (hex)" field, and you paste the distributor's value into the "Compare with expected value (optional)" field below it. If they match, a green "✓ Match — integrity verified" appears; if not, a red "✗ Mismatch — values differ" appears.

This comparison ignores leading and trailing whitespace and letter case. Whitespace picked up when you copy a value from a web page, or an uppercase value from PowerShell, will not trigger a false mismatch. However, characters mixed into the middle of the value, such as a filename, are still caught as a difference.

One order-of-operations note: in file mode, changing the algorithm clears the computed result, so choosing the algorithm first and then adding the file gets it done in one pass.

What a checksum guarantees and what it doesn't

This is the most important part of this post. Let's break down how far you can relax when you see a match indicator.

What it guarantees. That your file is byte-for-byte identical to the file the checksum was computed from. If even one byte differs, the entire value changes completely, so transmission damage or a swapped file gets caught by this comparison.

What it doesn't guarantee ①: that the file is safe. If the original itself does something you don't want, the checksum only tells you, correctly, that "this is the same as the original." Verifying integrity and judging whether something is malicious are two different layers.

What it doesn't guarantee ②: where the checksum value itself came from. If you got the file and the checksum from the same page and the same server, they share the same risk. If the file is changed on that server, the value printed next to it can change too.

The layer that closes this gap is a digital signature. If the distributor also provides a .asc or .sig signature file, or code signing, that is a separate step that verifies not just "the values match" but also "this distributor signed it."

What it doesn't guarantee ③: the cause of a mismatch. It tells you the values differ, but it doesn't distinguish whether that is download damage, a different version of the file, or something else.

What to check, in order, when you get a mismatch

Check orderDetails
1Are the algorithms the same for the distributor's value and yours? (Check by length)
2Is a filename or line break mixed into the pasted value?
3Is the distributor's value for the version and edition you downloaded?
4Do you get the same value after downloading again and recomputing? (If it's damage, the value usually changes)

Version labels are especially prone to mismatch. Even for the same program, the file differs depending on 32-bit vs. 64-bit, installer vs. portable, and whether language packs are included — so the checksums differ too.

Reproduce it yourself

If you want to confirm the value is computed correctly, you can test with a short string. The command below computes the SHA-256 of the eleven characters hello world with no line break.

printf 'hello world' | shasum -a 256
b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9  -

The - at the end of the output means "read from standard input, not a file," so the comparison target is the 64 characters before it.

Pasting the same string into the tool's Text tab gives the same value. Comparison works because of the property that the result is the same no matter which device computes it (determinism).

There is a reason we used printf instead of echo here. echo adds one newline character at the end, and that single character changes the entire hash value.

Summary

  • Check the algorithm in the distributor's value first. If it's SHA-256, the value is 64 hexadecimal characters.
  • You can compute the value with built-in commands. On Windows, certutil -hashfile file SHA256; on macOS and Linux, shasum -a 256 file.
  • If there's a SHA256SUMS, you can let shasum -a 256 -c SHA256SUMS handle the comparison for you.
  • A match means the file is byte-for-byte identical to the file that produced that value. It's not a guarantee that the file is safe.
  • If you downloaded the checksum and the file from the same place, source verification is a separate matter. That layer is handled by digital signatures.
  • If they don't match, check in this order: algorithm, a corrupted paste, then version differences.
File Hash (Checksum) Generator

Computes SHA-256, SHA-384, SHA-512, and SHA-1 right in your browser, and the files you add are never sent to a server.

Frequently asked questions

If the checksum matches, is the file safe?

A match only tells you that your file is byte-for-byte identical to the file that produced that checksum. What the original file itself is like is a separate question, and a checksum comparison doesn't settle it. Also, if you got the checksum from the same page as the file, the source of that value is itself unverified.

Why isn't MD5 in the list?

This tool computes with the Web Crypto feature built into your browser, and the hashes that spec supports are SHA-1, SHA-256, SHA-384, and SHA-512. MD5 isn't part of the spec, so it can't be computed in the browser. If the distributor only publishes MD5, use operating system commands (certutil -hashfile file MD5, md5sum, md5).

Is it okay to verify with SHA-1?

If the distributor only publishes an SHA-1 value, you can still compare against it. But SHA-1 is an algorithm where collisions — two different files sharing the same hash value — have been publicly demonstrated. If an SHA-256 value is available too, comparing against that one is better.

Are my files uploaded to a server?

No. Files are read in your browser and hashed right there, and nothing is sent to a server. That's why even a large ISO file is computed immediately with no upload wait, and how long it takes depends on file size and your device's performance.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. Is the Site Down? Check Whether It's Just You or the ServerLearn how to tell whether a site is down for everyone or just you, and what DNS, cache, and HTTP status codes reveal. Free URL status check included.
  2. What Can an IP Address Reveal? City and ISP, Not Your AddressAn IP lookup shows country, region, approximate city, ISP and ASN — never a home address. Here's why the pin lands in odd places, plus the legal path.
  3. Google Title Tag Pixel Width: Why Titles Get Cut ShortGoogle cuts search titles by pixel width, not character count. See why the 60-character rule is only an estimate and how to check it first.
  4. Why Online Timers Ring Late in Background TabsWhy a timer in another tab drifts or rings late, and how a target-time timer keeps the countdown exact even when the browser throttles background tabs.
  5. Wordle green, yellow, gray rules: duplicate letter logicSee exactly how Wordle decides green, yellow, and gray, and why the same letter can come up yellow once and gray the next time.
  6. ASRS Scoring for Adult ADHD: Positive Cutoffs ExplainedHow the WHO ASRS v1.1 Part A 6-question screener is scored, what 4 or more positives mean, and how to prepare before you see a doctor.

Related tools