Hashing Fundamentals

Verify Downloaded Files

A download can look perfectly ordinary and still be incomplete, damaged, or different from the file its publisher intended you to receive. Checking its checksum or cryptographic hash gives you a quick way to compare what arrived with a value published by a source you trust.

The process is straightforward: find the publisher’s reference value, calculate a hash of your local file, and compare the two. This guide walks through each step, explains what a match can—and cannot—tell you, and shows how to respond if the values differ.

What file verification checks

A hash function processes a file’s contents and produces a fixed-length value, often displayed as a string of letters and numbers. If even a small part of the file changes, a cryptographic hash such as SHA-256 will usually produce a very different result. You can calculate that value on your device and compare it with the publisher’s reference hash.

This is useful for catching accidental problems: a download that stopped early, a file altered during transfer, or a mismatch between the file you meant to download and the one you saved. The idea belongs to a broader practice called data integrity: checking whether data still matches a known reference.

Hashes have a long-standing role in computing because they turn a potentially large file into a compact value that is easier to compare. They are not encryption, though, and a matching hash does not by itself prove who created a file. For a clearer distinction, see checksums and hashes.

Before you begin: find a trustworthy reference

The comparison is only as dependable as the reference value. Look for the checksum or hash on the official download page, in the project’s official documentation, or through another channel the publisher identifies as authentic. Make sure the value refers to the exact file you downloaded and names the algorithm used—often SHA-256.

Trust matters: A hash copied from the same untrusted page or message as a suspicious download may simply confirm that the file matches what that source provided. Whenever possible, reach the publisher’s site independently by typing its address or using a trusted bookmark.

Some publishers also digitally sign files or publish signed checksum lists. A digital signature can help establish that a value came from a particular publisher, provided you can verify the signing key. A plain hash is a comparison tool; it is not a signature and does not authenticate its source.

Step 1: identify the exact file and algorithm

Check the filename, file extension, and download location. If the publisher lists several downloads, confirm that you have the right version and operating-system package. A hash for one installer will not match another installer, even if their names are similar.

Next, note the algorithm beside the reference value. SHA-256 is widely used for file checks. If a publisher provides SHA-256, calculate SHA-256 locally; comparing a SHA-256 value with an MD5 or SHA-1 result is not meaningful. These algorithms produce different outputs. For background on the names you may encounter, read SHA-2 and SHA-3 explained.

Older pages may list MD5 or SHA-1. These can help identify accidental changes in some contexts, but they are not recommended when strong protection against deliberate substitution is needed. Prefer a modern algorithm such as SHA-256 when the publisher offers one.

Step 2: calculate the hash on your device

Use a standard command-line utility already available on your system. Replace the example filename with the path to your downloaded file. Keep quotation marks around paths that contain spaces.

Windows PowerShell

Open PowerShell, then run:

Get-FileHash "C:\path\to\your-file.zip" -Algorithm SHA256

The output includes an algorithm and a long value labelled Hash. Check that the algorithm shown is SHA256.

Windows Command Prompt

Windows also includes certutil. In Command Prompt, run:

certutil -hashfile "C:\path\to\your-file.zip" SHA256

The hash appears between the command’s status lines. Copy the value carefully, without including surrounding text.

macOS

Open Terminal and run:

shasum -a 256 "/path/to/your-file.zip"

The command prints the SHA-256 value followed by the filename.

Linux

In a terminal, run:

sha256sum "/path/to/your-file.zip"

On systems where sha256sum is not available, check your distribution’s documentation for an equivalent trusted tool, such as sha256.

Step 3: compare the two values

Compare your locally calculated value with the publisher’s reference value. A match should be exact: every character must be the same. Letter case is usually not significant for hexadecimal values, but the characters and their order are. Some pages insert spaces or line breaks for readability; ignore those only if they are clearly formatting, not part of the value.

A SHA-256 value is typically shown as 64 hexadecimal characters. If the lengths differ, check that you copied the complete value and selected the same algorithm on both sides.

If the values match: The file you checked produces the same hash as the reference value. This is strong evidence that the file’s contents match the referenced version, assuming the reference itself is trustworthy.
If the values do not match: Treat the file as unverified. Do not install or open it simply because the filename looks right.

If the hash does not match

  1. Check the details. Confirm that the reference is for the same release, file, and algorithm. A single-character copying mistake can also cause an apparent mismatch.
  2. Download again from the official source. The first transfer may have been interrupted, or the file may have been changed or damaged after download.
  3. Calculate the new file’s hash. Make sure you are checking the new download rather than the earlier copy.
  4. Pause if it still differs. Contact the publisher through an independently verified support channel or check its official status and release notes. Do not rely on an unknown site or unsolicited message for reassurance.

A mismatch does not automatically mean an attack occurred. It can have ordinary causes, such as a newer release or an incomplete transfer. It does mean you have not confirmed that the file matches the reference you intended to check.

What a match cannot promise

A matching hash shows that the file’s calculated value agrees with the value you compared it against. It does not guarantee that the software is safe, free of bugs, or suitable for your device. Nor does it prove the publisher’s identity if the reference value was obtained from an untrusted source.

Cryptographic hashes are designed to make it extraordinarily difficult to create a different file with the same hash, but the assurance depends on the algorithm and how the reference is distributed. The wider topic of hash collisions explains why algorithm choice matters.

For a high-stakes download, follow the publisher’s full verification guidance. That may include verifying a digital signature, checking a signed manifest, or confirming the release through an additional trusted channel.

A quick checklist

  • I got the reference value from an official, trusted source.
  • The reference describes the exact file and release I downloaded.
  • I calculated the same hash algorithm named by the publisher.
  • The complete local value matches the reference exactly.
  • If anything differs, I will pause and verify before opening the file.

File verification is a small habit with a useful payoff: it replaces “the download seemed fine” with a clear comparison you can repeat. To build the foundation behind that check, continue with hashing basics or how hash functions work.

Theme