A checksum is a value calculated from a piece of data using a mathematical formula, and its sole purpose is to tell you whether that data is still intact. Send a file across a network, burn it to a disc, or store it on a hard drive, and there's always a chance something flips. A checksum catches that flip. It doesn't fix the problem, but it tells you the problem exists.
How a checksum is calculated
The process starts by feeding the original data, which could be a single text file or a full software installer, into a checksum algorithm. The algorithm processes every byte and returns a fixed-length output called a digest or hash. The most common checksum algorithms in everyday use are MD5, SHA-1, and the SHA-256 family.
MD5 produces a 128-bit output, usually shown as 32 hexadecimal characters. SHA-256 produces 256 bits, shown as 64 characters. The output length never changes regardless of input size. A single-line text file and a 10-gigabyte video archive both produce a SHA-256 output of exactly 64 characters.
The key property is that changing even one character in the source data produces a completely different checksum. That's not a coincidence or a convenience feature. It's baked into how algorithms like SHA-256 are designed. This property is called the avalanche effect: a tiny input change causes massive output change.
Checksums vs hash functions
People use "checksum" and "hash" almost interchangeably, and that's mostly fine. The technical distinction is narrow. A checksum was originally a simple sum of all bytes in a block, used to catch basic transmission errors. A hash function is a more sophisticated algorithm, designed to resist not just accidents but deliberate manipulation.
Simple checksums (like adding all bytes modulo 256) are fast and cheap, which makes them useful in hardware and low-level protocols. But they're easy to fool: a malicious actor could change two bytes in opposite directions so the sum stays the same. That's why file integrity verification now uses cryptographic hash functions rather than simple sums. Hash functions are designed with specific mathematical properties that make deliberate manipulation computationally impractical.
Where checksums are actually used
File downloads are the most visible use. When you download a Linux distribution or a software package, the provider usually lists a SHA-256 value next to the download link. You run the same algorithm on your downloaded file and compare outputs. If they match, the file arrived intact. If they don't, something went wrong in transit.
Package managers handle this automatically. When you install software via apt, Homebrew, or npm, the manager silently verifies the checksum of every downloaded package before installing it. You don't see it happen. The verification is there all the same.
Networking protocols use checksums at a lower level. The TCP/IP stack includes checksum fields in packet headers to detect corruption in transit. Each packet carries a checksum of its own payload, and the receiving device rejects any packet where the checksum doesn't match the data it received. This is happening thousands of times per second on any active internet connection. Network packets rely on checksums as a core integrity check at the hardware level.
Storage systems use checksums too. Modern file systems like ZFS compute and store checksums for every block of data written to disk. When a file is read back, ZFS recalculates the checksum and compares it to the stored value. This catches what's called silent data corruption, where data degrades on disk without any obvious error signal from the hardware.
What checksums can't do
A checksum tells you data has changed. It doesn't tell you how it changed or whether the change matters. A single corrupted bit and a completely rewritten file look identical from a checksum's perspective: both produce a mismatch.
Checksums also can't protect you if the reference value itself is compromised. If an attacker replaces a software file on a download server and also updates the published checksum, you'd see a match and think everything was fine. This is why serious software providers sign their checksums using cryptographic signatures. The signature is verified against a trusted public key, not just compared to a number on the same page. Public key infrastructure provides that layer of trust that bare checksums can't supply on their own.
There's also the question of algorithm age. MD5 was broken for security purposes years ago. Attackers can craft two different files that produce the same MD5 hash. This is called a collision attack. SHA-1 is compromised in a similar way. For anything involving security, SHA-256 or SHA-3 is the minimum sensible choice now. For basic file integrity checks with no adversarial risk, MD5 still works fine.
How to verify a checksum yourself
On macOS or Linux, open Terminal and run shasum -a 256 yourfile.zip. On Windows, use Get-FileHash yourfile.zip -Algorithm SHA256 in PowerShell. Both commands return a hex string. Compare it character by character with the value published by the file's source. Any mismatch means the file is not what it's supposed to be.
The comparison must be exact. One character wrong means a failed verification. Some tools, like sha256sum on Linux, automate the comparison by reading a text file of expected values and reporting pass or fail per file.
Checksums are small, fast, and cheap to compute. That's why they appear everywhere from ZIP files to networking hardware to blockchain records. The concept is simple. The underlying maths is sophisticated. And the protection they offer, when used correctly, is as reliable as anything in computing.

