Reviewed September 15, 2026

How to Verify a File Checksum with SHA-256

Compare a trusted SHA-256 digest with the hash of the file you received, and understand what a matching checksum does and does not prove.

A checksum answers one narrow question

A cryptographic hash converts the file bytes into a fixed-length digest. If one byte changes, the digest should change. When your SHA-256 result exactly matches a digest obtained from a trusted source, you have strong evidence that your copy matches the bytes represented by that published digest.

A match does not independently prove that the publisher is trustworthy, that the software is safe, or that the download page itself was not compromised. The trust path to the expected digest still matters.

Use this verification sequence

Get the expected SHA-256 digest from the software vendor, project release page, administrator, or another trusted channel before comparing it with your local file.

  1. 1
    Obtain the expected digest

    Copy the SHA-256 value exactly; avoid a random repost when an authoritative source exists.

  2. 2
    Hash the downloaded file

    Use a browser-local hasher, PowerShell, certutil, shasum, sha256sum, or another trusted local tool.

  3. 3
    Compare all hexadecimal characters

    Case does not matter, but every digit does. Do not compare only the first or last few characters.

  4. 4
    Treat mismatch as a stop signal

    Re-download from the trusted source and investigate rather than forcing installation/use.

Command-line examples

For large files, command-line utilities are convenient because they stream the file instead of copying all bytes into an application window.

Windows PowerShell
Get-FileHash .\installer.exe -Algorithm SHA256

macOS
shasum -a 256 installer.dmg

Linux
sha256sum installer.iso

Common reasons a hash does not match

You may have the wrong version, architecture, mirror, or archive; the publisher may have replaced a build without updating the digest; a proxy/transfer may have corrupted the file; or the digest may have been copied incorrectly. Do not normalize, unzip, edit, or re-save the file before hashing unless the publisher explicitly tells you to hash the transformed result.

SituationWhat to hash
Vendor publishes hash for installer.exeThe installer.exe bytes exactly as downloaded
Vendor publishes hash for release.zipThe ZIP file, not an extracted file
Administrator gives hash for final.pdfThe final PDF before any edits or metadata rewrite

When you publish checksums for your own files

Generate the digest only after the file is finalized. Publish the filename, algorithm, digest, and version/date together. If integrity or authenticity is high-stakes, consider signed release metadata or a digital-signature mechanism in addition to a bare hash.

Three real checksum scenarios

The strength of the comparison depends on the trust path for the expected digest. A checksum copied from the same compromised download location can still detect accidental corruption but offers less protection against coordinated replacement.

ScenarioExpected digest should come fromWhat a match tells you
Software installerSigned vendor release page/package metadataDownloaded bytes match the published artifact
Large client handoffSender through a trusted/separate channelTransferred archive matches the sender's finalized bytes
Evidence/data snapshotControlled manifest or evidence recordWorking copy is byte-identical to the recorded artifact

For many files, use a checksum manifest

A manifest records filename and digest for every final artifact. Generate it only after the files are frozen. If one file changes, update that row deliberately; do not regenerate the whole manifest and lose sight of which artifact changed.

Signed manifests or signed release metadata add publisher identity/authenticity that a bare SHA-256 line does not provide.

SHA256SUMS
5f2a…9c11  installer-x64.exe
a774…1b04  user-guide.pdf
8b1e…f552  sample-data.zip

A checksum mismatch is a stop signal, not something to round away

Compare the complete digest. Hexadecimal letter case can be normalized, but a single changed character means the values are different. Do not compare only the first few characters for a security-sensitive verification and do not edit the expected value to match the file you already downloaded.

Mismatch causes include incomplete transfer, wrong version/architecture, server-side replacement, line-ending/content changes in generated files, proxy/security rewriting or malicious substitution. Return to the trusted source, confirm filename/version, download again and investigate if the mismatch persists.

Checksum mismatch workflow
1
Stop

Do not run/use the file as verified.

2
Confirm expected digest

Correct version, filename and trusted source.

3
Recalculate locally

Same algorithm over the exact file bytes.

4
Redownload/retransfer

Use the trusted distribution path.

5
Escalate persistent mismatch

Publisher/source may have changed or transfer path needs review.

A checksum proves byte equality; a digital signature can add publisher identity

SHA-256 by itself has no concept of who created a file. If a trusted party publishes the expected digest through an authenticated channel, the comparison inherits trust from that channel. A digital signature or signed release manifest can go further by cryptographically binding release metadata to a signing identity/key.

For ordinary transfer-integrity work, a trusted expected SHA-256 may be enough. For software distribution, regulated evidence or high-stakes releases, document the provenance of the digest or use the established signing mechanism rather than describing a bare hash as authentication.

MechanismAnswersDoes not answer by itself
SHA-256 comparisonAre these bytes the same as the bytes represented by the expected digest?Who published/signed the file? Is it safe to run?
Signed manifest/release metadataDid the holder of the signing key approve these recorded hashes/metadata?Whether the signed software/content is benign or correct
Malware/security analysisBehavior/risk indicatorsWhether the file is the exact intended release unless provenance/integrity is also checked

Primary references and current-source checks

Requirements, policies and platform guidance can change. Recheck these sources when the decision matters.

NIST — Secure Hash Standard (FIPS 180-4) ↗
Use the browser tool

Apply the workflow to your own file or trade record.

Open Hash Generator