Skip to main content

Developer guide

Verify a SHA-256 file checksum before using a download

By MultiZest · · 3 min read

A checksum is a compact value calculated from a file’s bytes. Comparing it with a trusted expected value can reveal a changed or incomplete download. The reference matters: a matching digest from an untrusted source does not establish that the file is safe.

The practical takeawayGet the expected digest from a trustworthy source, select the same algorithm and compare the complete value. A checksum is not a malware scan.

Obtain the correct reference

Look for the digest associated with the exact version, platform and filename you downloaded. A checksum for a Windows package will not normally match a Linux package, and a new release can legitimately have a different value.

Use the publisher’s authenticated website or an appropriate signed manifest. If the same compromised source supplies both a malicious file and its checksum, the two can match. A digital signature can address a different authenticity question when verified through a trusted key.

Choose the matching SHA-2 algorithm

Paste only the hexadecimal digest in the expected-value field. Remove filenames, algorithm labels and other manifest formatting. Uppercase and lowercase hex represent the same value.

AlgorithmHexadecimal lengthUse in this tool
SHA-25664 charactersDefault file verification option
SHA-38496 charactersChoose when the publisher specifies it
SHA-512128 charactersChoose when the publisher specifies it

Calculate locally and read the result

Open File Checksum Verifier, choose the file, select the algorithm and paste the expected digest. The browser reads the file and produces Match, Mismatch or Hash calculated when no reference was supplied.

For a reproducible small test, create a UTF-8 file containing exactly abc without a newline. Its SHA-256 digest is ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. Adding a newline changes the bytes and therefore the digest.

Investigate a mismatch before using the file

First confirm the algorithm and exact release. Check whether the download was incomplete, whether an archive was extracted before comparison, or whether an editor changed line endings. Compare the file the publisher intended, not a modified derivative.

If those checks do not explain the mismatch, obtain a fresh copy from the trusted publisher and investigate its guidance. Do not simply overwrite the expected digest with the value you calculated; that removes the independent comparison.

Understand browser and security limits

This implementation uses Web Crypto and requires HTTPS or localhost. It accepts files up to 100 MB and reads the file into memory. A large file can still put pressure on a low-memory device.

The file is processed locally, but an untrusted device, extension or operating system can undermine a secure workflow. The verifier does not scan for malware, validate an executable’s publisher certificate or recover a corrupted file. Use additional checks appropriate to the download.

Check the archive, version and reference together

A digest for a downloaded archive does not describe an extracted folder or a repackaged ZIP. Verify the exact file named by the release instructions and use the algorithm attached to that reference.

If the values differ, check whether the publisher released a new version or the transfer was incomplete. Do not accept an unexplained mismatch merely because the file opens or its name looks familiar.

Keep integrity and trust as separate conclusions

A matching digest confirms agreement with the reference bytes. If both the file and reference came from an untrusted source, that agreement does not establish the publisher’s identity or the file’s safety.

Obtain the expected value through a trusted release channel and use the surrounding download-verification process appropriate to the software. Save the result when it forms part of a repeatable installation or audit record.

Try the tools used in this guide

Sources and further reading

Continue reading