Felix ReportIndependent Reporting and News

How to verify a downloaded file with a SHA-256 checksum

Laptop terminal displaying abstract checksum rows beside a downloaded file icon and comparison card.

A SHA-256 checksum gives you a practical way to check whether a downloaded file matches the bytes its publisher intended to distribute. Calculate the checksum on your computer, compare it with the value on the official download or release page, and do not open the file if even one character differs.

The method is useful for installers, disk images, firmware, archives and other large downloads. It can reveal a corrupted transfer or a file that does not match the published original. It is not a complete authenticity guarantee, because an attacker who changes both the file and the checksum displayed beside it can make the two match.

Find the publisher's reference value first

Look on the official release page for a label such as SHA-256, SHA256, checksum, digest or hashes. A SHA-256 value is normally shown as 64 hexadecimal characters, using the digits 0 through 9 and the letters a through f.

Confirm that the value belongs to the exact file you downloaded. A release may provide different files for Windows, macOS, Linux, processor architectures or languages. Similar filenames can have different checksums, and a checksum from an earlier software version will not match a newer package.

Prefer the provider's official HTTPS site or release repository. If the provider publishes a signed checksum file, that can offer stronger evidence because the signature can be checked against a trusted public key. Save the expected value or leave the official page open while you calculate the local result.

Do not obtain the file from one unofficial mirror and the checksum from another arbitrary page. A comparison is only as trustworthy as the reference value. If no official checksum is available, a hash calculator can still produce a value, but there is nothing authoritative to compare it with.

Calculate SHA-256 on Windows

PowerShell includes the Get-FileHash command. Open PowerShell, type the command followed by the path to the downloaded file, and press Enter:

Get-FileHash -Algorithm SHA256 "C:\Users\YourName\Downloads\example-file.iso"

PowerShell returns the algorithm, a hash and the file path. SHA-256 is the default algorithm for the command, but specifying it makes the intended comparison explicit.

Microsoft's >Get-FileHash documentation (opens in a new tab) says MD5 and SHA-1 should not be used to protect against deliberate tampering. Older release pages may still publish those values for basic change detection, but choose SHA-256 or a stronger modern option when the provider offers one.

If the path is long, you can type Get-FileHash -Algorithm SHA256 with a trailing space and then drag the file from File Explorer into the PowerShell window. Check the inserted path before running the command. Dragging helps avoid typing errors, but it does not replace the need to verify that you selected the intended file.

Calculate SHA-256 on macOS

macOS includes the shasum utility. Open Terminal and run:

shasum -a 256 "/Users/YourName/Downloads/example-file.dmg"

The command prints the checksum followed by the filename. Apple documents the same shasum -a 256 pattern when creating a package hash for Apple Business workflows.

You can avoid typing a long path by entering shasum -a 256 and dragging the downloaded file from Finder into Terminal. The shell inserts the path. Make sure the command still contains a space before the path and that quotation marks are preserved if the filename contains spaces.

Terminal commands act on the file at the path you provide. If you downloaded two copies with similar names, such as example.dmg and example-1.dmg, verify which one you plan to open before calculating the result.

Calculate SHA-256 on Linux

Many Linux distributions include GNU Coreutils and its sha256sum command. In a terminal, run:

sha256sum "/home/yourname/Downloads/example-file.tar.xz"

The output begins with the checksum and ends with the filename. GNU also supports checksum files that can be checked automatically. If a trusted publisher supplies a file such as SHA256SUMS, place it in the expected directory and run:

sha256sum --check SHA256SUMS

Automatic checking is convenient when a release contains many files, but read the output carefully. The checksum file may list packages you did not download, which can produce missing-file messages. The important result is whether the specific package you intend to use is reported as valid.

Some systems now present the more general cksum utility as the modern interface, while sha256sum remains widely available. Use the tool documented by your distribution and make sure the selected algorithm is SHA-256.

Compare the two values without shortcuts

The calculated value must match the published value from the first character to the last. Letter case is not important for hexadecimal notation, but every hexadecimal digit is. A single difference means the files are not identical.

Copying both values into a plain-text editor can make comparison easier. Avoid an online checksum site for sensitive or private files, because uploading the file may disclose its contents to another service. Local tools calculate the value without sending the file away.

If the values match, you have evidence that your local file is byte-for-byte consistent with the reference checksum. If they do not match, do not proceed with installation. Delete the mismatched copy, return to the official source, verify that you selected the correct version and download it again.

Repeated mismatches can have ordinary causes. The download may be incomplete, a proxy or storage device may have altered the file, or the provider may have replaced the release without updating every page. They can also indicate that you have the wrong file. Treat the mismatch as a stop signal, not as a puzzle to bypass.

Understand what a match does not prove

A checksum checks file integrity against a reference value. It does not independently prove who created the file. If an attacker controls the download page and can replace both the package and the displayed hash, the comparison will succeed even though the source is malicious.

Digital signatures address a different question. They can connect a file or checksum list to a signing key controlled by the publisher, provided you verify the key through a trusted route. Operating-system signature checks, package-manager signatures and PGP-signed checksum files can therefore add confidence beyond a plain hash comparison.

A matching checksum also does not prove that the software is safe, free of vulnerabilities or appropriate for your system. It only shows that the bytes match the published reference. Normal precautions still matter: use the official source, keep the operating system current, inspect unexpected permission requests and maintain a recoverable backup before major firmware or system changes.

A short verification routine

Use the same sequence whenever a publisher provides a checksum:

  1. Download the file from the official source.
  2. Find the SHA-256 value for that exact filename and version.
  3. Calculate SHA-256 locally with the built-in tool for your operating system.
  4. Compare all 64 hexadecimal characters.
  5. Stop if they differ, and investigate before opening the file.
  6. Where available, verify the publisher's digital signature as an additional identity check.

This routine takes less time than recovering from a corrupted installer or an untrusted package. Its strength comes from a precise comparison and a trustworthy reference, not from the hash value alone.