Verifying File Integrity with Checksums

Last reviewed on May 11, 2026

A checksum is a short fingerprint computed from a file's contents. Two files that produce the same checksum are byte-for-byte identical; changing even a single bit anywhere in the file produces a completely different checksum. That property is why every major software project publishes checksums alongside its downloads, and why anyone moving important data between systems should be in the habit of checking them.

This page covers the practical mechanics: which algorithm to use, the commands that compute checksums on each operating system, and how to compare a computed value against a published one without falling into the small traps that catch most people on a first try.

What problems checksums actually solve

Checksums are good at telling you that a file you have matches a file someone else expected. They catch:

They are not a defence against tampering when the attacker controls both the download and the published checksum on the same page. For that case, cryptographic signatures (PGP, code signing) are the right tool; checksums are about integrity, not authenticity.

Which algorithm to use

Three algorithms account for the overwhelming majority of published checksums:

A published download page may list more than one. Match whichever one is published; mixing algorithms doesn't make verification stronger.

Computing a checksum on Windows

Windows ships with certutil, which has computed checksums for decades, and PowerShell's Get-FileHash, which is more pleasant to read. Either works without installing anything.

certutil -hashfile installer.exe SHA256
Get-FileHash installer.exe -Algorithm SHA256

certutil prints a colon-separated hash you'll usually want to strip; Get-FileHash shows the algorithm, the hash, and the path in three clean columns. For MD5 or SHA-1, swap the algorithm name.

Computing a checksum on macOS and Linux

Both ship with dedicated commands per algorithm:

md5sum installer.iso       # Linux
md5 installer.iso          # macOS
sha1sum installer.iso      # Linux
shasum installer.iso       # macOS (defaults to SHA-1)
sha256sum installer.iso    # Linux
shasum -a 256 installer.iso  # macOS

On either platform, the output is the hash followed by the filename. Comparing it to a published value is the next step.

Comparing the result safely

Eye-balling two 64-character hex strings is a recipe for missing a single-character change in the middle. Three safer approaches:

Decision criteria: when to actually bother

Verifying every file you ever touch is overkill. The high-value cases are:

For everyday documents, the network and filesystem layers do enough integrity checking that manual verification would be busywork. Use judgement; checksums are a tool, not a ritual.

Common mistakes

What a mismatch means

If a downloaded file's hash doesn't match the published value, the file is not what the publisher released. In order of likelihood: the download was interrupted, a content-delivery network served a stale or partial copy, antivirus modified the file in transit, or — much less commonly — the file was tampered with. The standard recovery is to redownload from the official source, ideally from a different network if available, and re-verify.

A mismatch during a copy or restore points either at the source media (failing drive, dirty disc) or at the destination. Our guide on corrupted files covers what to do next; a second mismatch on the same operation is a strong signal that the storage hardware is failing and should be replaced before any further writes.

Where this fits

Integrity verification pairs naturally with the rest of the safety basics covered on the site: backing up important files means little if you can't tell whether the backup still matches the original, and the slow downloads guide covers the upstream causes of the truncated-file pattern you'll detect here. A short checksum at the end of a large transfer is the cheapest way to make data movement provable.