To verify a SHA256 checksum, hash the file you downloaded and compare all 64 characters with the value the publisher lists. On Windows run Get-FileHash file.iso in PowerShell, on Linux sha256sum file.iso. A match proves the file is the same as the one the checksum was made from. It proves the file is the one the publisher released only if the checksum itself came from a source an attacker could not have changed.

The commands and outputs below were run on a Linux machine on 29 November 2026 (GNU coreutils 9.4, GnuPG 2.4.4, Perl shasum 6.04). The Windows and macOS commands come from Microsoft’s and Ubuntu’s documentation and were not run for this guide.

The command for each system

System Command Source
Windows (PowerShell) Get-FileHash C:\Users\you\Downloads\file.iso Microsoft Learn: Get-FileHash
Windows (Command Prompt) certutil -hashfile file.iso SHA256 Microsoft Learn: certutil
Linux sha256sum file.iso Ubuntu tutorial
macOS shasum -a 256 file.iso, or sha256sum after brew install coreutils Homebrew route from the Ubuntu tutorial
Any system with OpenSSL openssl dgst -sha256 file.iso run for this guide

Microsoft documents that Get-FileHash uses SHA256 when you give no algorithm, and accepts SHA1, SHA256, SHA384, SHA512 and MD5. It returns three properties: Algorithm, Hash and Path. Microsoft’s certutil page lists MD2, MD4, MD5, SHA1, SHA256, SHA384 and SHA512 as hash algorithms. The same Microsoft page warns that MD5 and SHA1 “should only be used for simple change validation” and not for files that need protection from tampering, so always ask for SHA256 when the publisher offers it.

On the macOS row: shasum -a 256 is the command we ran on Linux (it prints the same hash as sha256sum, shown below). We did not run it on a Mac.

SHA-256 itself is specified in FIPS 180-4, published by NIST in August 2015. NIST added a planning note on 7 March 2023 saying the standard will be revised. The page lists the standard as final.

A worked example: three outcomes

We made a 1,288,895-byte test file, demo.iso (the numbers 1 to 200,000, one per line), and ran each tool on it. All three print the same 64 hex characters:

sha256sum:     5af7b95208fdcff454bab3f5eddf567a688a3796c703d4fef91072e38645c062  demo.iso
shasum -a 256: 5af7b95208fdcff454bab3f5eddf567a688a3796c703d4fef91072e38645c062  demo.iso
openssl:       SHA2-256(demo.iso)= 5af7b95208fdcff454bab3f5eddf567a688a3796c703d4fef91072e38645c062

We then saved that line as a checksum list and ran sha256sum -c against three files:

File What we did Output Exit code
demo.iso Nothing, it is the original demo.iso: OK 0
bad.iso Changed one byte (a single character at offset 1,000) bad.iso: FAILED and sha256sum: WARNING: 1 computed checksum did NOT match 1
cut.iso Cut off after 1,048,576 bytes, as an interrupted download would cut.iso: FAILED and the same warning 1

The changed file hashes to 26ef7828...8ba214, which shares nothing recognisable with the original. That is the point of the check: a one-character difference in 1.2 MB changes the whole value, so you do not need to compare anything but the result. For scripts, the exit code is the useful part: 0 for a match, 1 for a failure.

A hash tool prints the value whether or not you have the right file. It cannot tell you whether the hash you compare it with is trustworthy. That second question is the next section.

Where the checksum comes from decides what a match proves

Where you got the expected hash A match proves A match does not prove
Same page or server as the download The download was not corrupted or cut short That nobody replaced both the file and the hash
A different page you trust, over HTTPS The file equals what that page published That the publisher’s own systems were not compromised
A checksum file with a verified digital signature The file is what the publisher’s signing key vouched for That the publisher’s key is the one you meant to trust, unless you checked its fingerprint

Ubuntu publishes the third kind. We downloaded SHA256SUMS and SHA256SUMS.gpg for Ubuntu 24.04 from releases.ubuntu.com and followed the Ubuntu tutorial: gpg --keyid-format long --verify SHA256SUMS.gpg SHA256SUMS. With the signing keys imported, GnuPG answered:

gpg: Signature made Tue Sep 15 19:11:12 2026 UTC
gpg:                using RSA key 843938DF228D22F7B3742BC0D94AA3F0EFE21092
gpg: Good signature from "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
Primary key fingerprint: 8439 38DF 228D 22F7 B374  2BC0 D94A A3F0 EFE2 1092

That fingerprint matches the one printed on Ubuntu’s tutorial page for key D94AA3F0EFE21092, which also lists C598 6B4F 1257 FFA8 6632 CBA7 4618 1433 FBB7 5451 for the older key 46181433FBB75451. The “not certified” warning is expected: per the tutorial, it only means you have not marked the key as trusted yourself. The fingerprint comparison is how you establish trust.

Then we changed one character of the checksum list, from faabcf33 to faabcf34, and ran the same command on the edited copy:

gpg: BAD signature from "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>" [unknown]

This is what a signature adds over a bare hash: someone who edits the checksum list to match a tampered ISO breaks the signature. The SHA256SUMS file we read had a Last-Modified header of 15 September 2026 and listed nine images.

The steps, in order

  1. Download the file, and the checksum from the place the publisher recommends. If there is a signed checksum list, download the signature too.
  2. If there is a signature, verify it first (gpg --verify) and compare the key fingerprint with the one the publisher prints on its own site.
  3. Hash your file with the command from the first table.
  4. Compare the whole 64-character result with the expected value. Hexadecimal digits are the same in upper and lower case, so ABCD and abcd are the same value.
  5. With a list, use sha256sum -c SHA256SUMS in the folder that holds the file, rather than comparing by eye.

One trap with lists: Ubuntu’s SHA256SUMS names several images, and you probably downloaded one. For each file you do not have, sha256sum -c prints sha256sum: <name>: No such file or directory followed by <name>: FAILED open or read. Ubuntu’s tutorial filters with sha256sum -c SHA256SUMS 2>&1 | grep OK; GNU coreutils also has an --ignore-missing option to skip names you do not have. The * before each name in the list marks binary mode and is not part of the file name.

When the hashes do not match

  • Check for a wrong or newer version first. Point releases get new hashes. The Ubuntu 24.04 list above holds hashes for 24.04.3, 24.04.4, 24.04.5 and 24.04.5.1.
  • Download again. A cut-off download fails exactly as cut.iso did above.
  • Check you are comparing the same algorithm. A 32-character value is MD5 and a 40-character value is SHA-1; neither can be compared with a SHA-256 value.
  • Do not run the file if a fresh download from the official site still fails. The Ubuntu tutorial’s reading is that a mismatch means the image “does not match the checksum”, which could be tampering or a bad download.

For a different kind of “does this match” question, one about whether a binary was built from published source code, see reproducible builds; for how build systems attest what they produced, see SLSA build provenance.