How to Verify File Integrity with Checksums
What a checksum actually proves, how hashing works, and practical guidance on MD5 vs SHA-1 vs SHA-256 vs SHA-512 for verifying downloads.
What a Checksum Actually Verifies
A checksum (or hash) is a fixed-length string generated from a file's contents using a hashing algorithm. Its job is narrow but useful: confirm that a file hasn't been corrupted or altered since the hash was generated. If even a single bit of the file changes, the resulting hash changes completely and unpredictably โ this is known as the avalanche effect.
What a checksum does not do on its own is prove who created the file or that it's safe to run โ it only proves the file matches the exact bytes the hash was generated from.
How Hashing Works, at a High Level
A cryptographic hash function takes an input of any size and produces a fixed-length output โ for example, SHA-256 always produces a 256-bit (64 hex character) output, whether you hash one byte or ten gigabytes. Three properties matter for integrity checking:
- Deterministic โ the same input always produces exactly the same output.
- One-way โ you cannot feasibly reconstruct the original input from the hash alone.
- Collision-resistant (for strong algorithms) โ it should be computationally infeasible to find two different inputs that produce the same hash.
MD5 vs SHA-1 vs SHA-256 vs SHA-512: Practical Guidance
MD5 and SHA-1 are both considered cryptographically broken โ practical collision attacks exist for both, meaning a motivated attacker can craft two different files that produce the same hash. They're still commonly seen for basic accidental-corruption checks (confirming a download wasn't truncated or damaged in transit) but should not be trusted for anything where an adversary might deliberately try to fake a match.
SHA-256 is the current practical standard for security-sensitive verification โ software downloads, checksums published alongside releases, and most modern security tooling. No practical collision attack is known against it.
SHA-512 offers a larger output and a similar security margin to SHA-256, with a small performance difference depending on the platform (SHA-512 can actually be faster on 64-bit hardware despite the longer output).
Generate any of these instantly with the Hash and Checksum Generator, from text or from a file directly in your browser.
Worked Example: Verifying a Downloaded File
Say a vendor publishes a software download alongside this line:
After downloading the file, generate its SHA-256 hash yourself and compare it character-by-character against the published value. An exact match confirms the file downloaded completely and wasn't corrupted or altered in transit. Any difference โ even a single character โ means something changed, and the file should not be trusted or run until re-downloaded from a verified source.
When Checksums Aren't Enough
A checksum only proves the file matches the bytes the hash was generated from โ it says nothing about whether the source publishing that hash is trustworthy in the first place. If an attacker compromises the download page itself, they can publish a malicious file alongside a matching malicious hash, and the checksum will "verify" perfectly.
For genuine authenticity โ proving a file actually came from who it claims to be from, not just that it matches a given hash โ you need code signing (a cryptographic signature tied to a verified publisher identity) or PGP/GPG signing, which checksums alone don't provide.
Tools For This Guide
Frequently Asked Questions
Generate or Verify a Checksum Now
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes from text or files, entirely in your browser.