File Integrity Verification with SHA-256

How SHA-256 detects file corruption and tampering. Checksum workflow, hash-file comparison, command-line verification, and download verification patterns.

ZERO UPLOAD · ALL LOCAL
  1. Type or paste any string into the input box — all four hashes update instantly as you type.
  2. Use the HEX / BASE64 toggle above the results to switch output format at any time.
  3. Click Copy next to any hash to copy it to the clipboard in the current format.
  4. Switch to HMAC, enter your secret key, and pick an algorithm to generate a keyed digest for API signatures or webhook verification.
  5. SHA-256 is the recommended algorithm for new integrations. MD5 and SHA-1 are shown for legacy compatibility only.

What this page covers

  • Linux verification sha256sum -c checksums.txt
  • macOS verification shasum -a 256
  • Windows verification Get-FileHash -Algorithm SHA256 in PowerShell
  • Trusted source rule fetch the checksum from the publisher's own HTTPS page, not the same mirror serving the file
MD5 LEGACY
SHA-1 LEGACY
SHA-256 RECOMMENDED
SHA-512 SECURE
SHA-256

File Integrity Verification with SHA-256

When you download software, archives, or deployment artifacts, file integrity checks catch corruption before it causes problems. SHA-256 produces a 64-character fingerprint for any file, regardless of size.1 Because a single flipped bit in the file produces a completely different hash, comparing the computed hash against a published checksum immediately reveals whether the file was corrupted in transit, incompletely downloaded, or modified since the checksum was created.2

Publishers distribute SHA-256 checksums alongside software downloads so you can verify you received the authentic file. Ubuntu, for example, publishes a SHA256SUMS file beside each release image, and the safe workflow is to compare your computed SHA-256 against the value from the publisher's official HTTPS page rather than a mirror.3

How file integrity checking works

SHA-256 operates as a one-way function. The publisher computes the hash of the original file and publishes the 64-character hex string alongside the download link.1 You download the file, compute its SHA-256 locally, and compare your result to the published value. Consequently, if even one byte was altered - whether by a hardware error during transfer, a network glitch, or an adversary modifying the server - the hashes differ. The comparison is binary: either the hashes match exactly or they do not. There is no partial match and no grey area.

Getting the checksum from a trusted source

The checksum itself must come from a trustworthy location. Download the file from a mirror if you want, but fetch the SHA-256 value from the publisher's official HTTPS page or a signed release channel. If both file and checksum come from the same untrusted mirror, the comparison can still pass while the content has changed. The trust model matters: a checksum is only as trustworthy as the channel that delivered it, so always prefer the publisher's primary domain over third-party aggregation sites that might lag behind or serve modified files.

You strengthen the check by fetching the published value from the publisher's primary domain over HTTPS rather than from a mirror that may serve the same file and a different checksum. A checksum is only as trustworthy as the channel that delivered it, so the source matters as much as the comparison. CapyToolkit lets you compare a computed SHA-256 against the publisher's value locally, so the bytes never leave your browser during the check.

Choosing SHA-256 over MD5 and SHA-1

MD5 and SHA-1 checksums remain common in older software repositories but carry a known risk. RFC 6151 states that published attacks make MD5 imprudent wherever collision resistance is required, while also noting that MD5 can still be useful for simple error checking.4 For SHA-1, Google and CWI announced the first practical collision in 2017 and released two PDFs with identical SHA-1 hashes but different contents.5 NIST's SP 800-131A treats the SHA-2 family as acceptable for all hash-function applications, so when you have a choice, verify against SHA-256.6 Yet when a publisher only provides MD5, verifying it still catches accidental corruption - collisions require deliberate effort, not random bit flips.

Knowing what the check does not prove

A matching SHA-256 checksum proves the file matches the publisher's published bytes; it does not prove the software is safe to install. You still need to trust the publisher, keep systems patched, and scan or review sensitive installers. Integrity verification is one layer in a safer download workflow, not a substitute for vendor trust. A checksum confirms the bytes are identical to what the publisher released, but it cannot tell you whether those bytes contain vulnerabilities, malware, or unwanted behavior that the publisher themselves included in the release.

Practical implementation patterns

Most operating systems provide command-line tools for SHA-256 verification. On Linux, use sha256sum: compare with sha256sum -c checksums.txt.7 On macOS, use shasum -a 256.8 On Windows, use Get-FileHash -Algorithm SHA256 in PowerShell.2 Building on this workflow: automate checksum verification in CI pipelines by pinning each downloaded tool to its expected SHA-256 and failing the build if the hash changes. GitHub Actions run steps execute shell commands in the workflow, so checksum verification requires an explicit command such as sha256sum -check or the equivalent PowerShell cmdlet.9 npm also records package integrity hashes in package-lock.json, which is the same integrity-pinning idea applied to dependency installation.10

Keeping verification reproducible in automation

Record the exact command and checksum file in your build log so another developer can reproduce the result. If a CI job fails because the computed hash changed, treat the pinned checksum as a security-sensitive dependency update. Require a pull request, inspect the new artifact source, and then publish the new SHA-256 deliberately. Every hash update should include a note explaining why the artifact changed, who approved the new checksum, and where the new value was obtained, so the audit trail connects the pinned hash to a specific human decision rather than an automated refresh that nobody reviewed.

Automating SHA-256 verification in CI and deployment pipelines

Build pipelines that download external binaries, model weights, or data archives should verify SHA-256 checksums before using the downloaded artifact. Pin each expected hash as a constant in your CI configuration. After downloading, compute the file's SHA-256 and compare it to the pinned value. Fail the build immediately if they differ rather than logging a warning and continuing with an unverified file.9

GitHub Actions run steps execute shell commands in the workflow, so checksum verification requires an explicit command such as sha256sum -check checksums.txt or the equivalent PowerShell cmdlet. Store the expected hash as a repository constant that requires a pull request to update. A pull request review gate on any hash change ensures every new binary version passes deliberate human review before entering your pipeline.

When to use this

Use SHA-256 file verification immediately after downloading any software installer, OS image, archive, or binary that carries a published checksum. Before you trust the install, compare a download against the publisher's SHA-256 rather than assuming a complete transfer means an unmodified one. You should also verify files received through email, file transfer, or any channel where the file could have been modified in transit.

Examples

Verifying an Ubuntu ISO download

Before
File: ubuntu-24.04-desktop-amd64.iso
Published SHA-256 from ubuntu.com:
8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3
After
Computed SHA-256: 8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3
Result: MATCH  - download is authentic and complete.

Drag the ISO into the Hash Generator and compare the SHA-256 output against the checksum listed on the Ubuntu download page.

Verifying a software installer from a mirror site

Before
Downloaded from third-party mirror: app-v2.1.0-setup.exe
Expected SHA-256 from developer's official site: a3f4b8...
After
Computed SHA-256: matches publisher's value
Result: installer is unmodified  - safe to run.

Always compare against the checksum published on the developer's official domain, not the mirror.

Sources
  1. 1.

    NIST, “FIPS 180-4, Secure Hash Standard,” August 2015. https://csrc.nist.gov/pubs/fips/180-4/upd1/final

  2. 2.

    Microsoft, “Get-FileHash,” Microsoft Learn PowerShell, accessed June 2026. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7.6

  3. 3.

    Ubuntu, “SHA256SUMS,” Ubuntu 24.04 release files, accessed June 2026. https://www.releases.ubuntu.com/24.04/SHA256SUMS

  4. 4.

    IETF, “Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms,” RFC 6151, March 2011. https://datatracker.ietf.org/doc/html/rfc6151

  5. 5.

    Google, “Announcing the first SHA1 collision,” Google Online Security Blog, February 2017. https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html

  6. 6.

    NIST, “SP 800-131A Rev. 2, Transitioning the Use of Cryptographic Algorithms and Key Lengths,” March 2019. https://csrc.nist.gov/pubs/sp/800/131/a/r2/final

  7. 7.

    GNU coreutils, “sha256sum,” Linux manual page, April 2026. https://www.man7.org/linux/man-pages/man1/sha256sum.1.html

  8. 8.

    Mark Shelor, “shasum,” Perl Programmers Reference Guide, October 2021. https://keith.github.io/xcode-man-pages/shasum.1.html

  9. 9.

    GitHub, “Workflow syntax for GitHub Actions,” GitHub Docs, accessed June 2026. https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsrun

  10. 10.

    npm, “package-lock.json,” npm Docs, accessed June 2026. https://docs.npmjs.com/cli/v11/configuring-npm/package-lock-json/

FAQ