You download a large archive, a firmware image or a game mod, and next to the link is a short code such as 414fa339 labelled "CRC32". Or a ZIP tool complains of a "CRC error" when extracting. Or a data pipeline stores an eight-character hex value next to every record. All three are the same idea: a small fingerprint that tells you whether data arrived intact.
This guide explains what a CRC-32 checksum is, why it is excellent at catching accidental corruption but useless against deliberate tampering, how it compares with Adler-32 and cryptographic hashes, and how to calculate one for text or a file.
What a checksum is
A checksum is a short value calculated from a block of data. If even one bit of the data changes, the checksum almost certainly changes too. The sender publishes or stores the checksum; the receiver recalculates it and compares. A mismatch means the data was damaged somewhere: a flaky network, a failing disk, an interrupted download or a bad copy.
How CRC-32 works
CRC stands for Cyclic Redundancy Check. Conceptually, it treats the data as one very long binary number and divides it by a fixed "generator polynomial" using binary arithmetic without carries. The remainder of that division is the checksum. For CRC-32 the remainder is 32 bits long, usually written as eight hex digits.
In practice, implementations use a precomputed 256-entry lookup table and process one byte at a time, which makes CRC-32 very fast. This short JavaScript version produces the standard CRC-32 used by ZIP, gzip and PNG:
const TABLE = new Uint32Array(256).map((_, n) => {
let c = n;
for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
return c;
});
function crc32(bytes) {
let crc = 0xffffffff;
for (const b of bytes) crc = TABLE[(crc ^ b) & 0xff] ^ (crc >>> 8);
return (crc ^ 0xffffffff) >>> 0;
}
const data = new TextEncoder().encode("The quick brown fox jumps over the lazy dog");
console.log(crc32(data).toString(16).padStart(8, "0")); // 414fa339
The mathematics gives CRCs useful guarantees for the errors that real hardware produces: they detect all single-bit errors and all burst errors (runs of flipped bits) up to 32 bits long, and random corruption slips through only about once in four billion times.
Where CRC-32 is used
- ZIP archives store a CRC-32 for every file, which is where "CRC failed" extraction errors come from.
- gzip files end with a CRC-32 of the uncompressed data.
- PNG images have a CRC-32 on every chunk.
- Ethernet frames carry a CRC-32 in their trailer.
- Download pages, emulator and retro-gaming communities, and data pipelines often publish CRC-32 values as quick fingerprints.
Note that several different CRC-32 variants exist, using different polynomials or settings. The one above (sometimes called CRC-32/ISO-HDLC) is by far the most common. The Unix cksum command, for example, uses a different CRC algorithm, so its output will not match a ZIP-style CRC-32.
CRC-32 versus Adler-32, MD5 and SHA-256
| Algorithm | Size | Speed | Detects accidents | Resists tampering | Typical use |
|---|---|---|---|---|---|
| Adler-32 | 32 bits | Very fast | Good for longer data, weaker for short inputs | No | zlib streams |
| CRC-32 | 32 bits | Very fast | Very good | No | ZIP, gzip, PNG, networking |
| MD5 | 128 bits | Fast | Excellent | No (broken) | Legacy file checks |
| SHA-256 | 256 bits | Moderate | Excellent | Yes | Software downloads, security |
The key column is "resists tampering". CRC-32 is linear: an attacker can modify a file and then adjust four bytes to force the same CRC. That is trivial, not theoretical. So:
- Use CRC-32 to catch accidental corruption, where speed matters and nobody is trying to fool you.
- Use SHA-256 when you need to be sure a file has not been deliberately altered, such as a software installer. The Hash Generator calculates SHA-256 and other hashes.
- Use an HMAC when the check must also prove who created the data; see the HMAC Generator.
Adler-32 is faster still, and zlib uses it for its streams, but it is known to be weaker than CRC-32 for short messages. Unless a format specifies Adler-32, CRC-32 is the better default for error detection.
Calculate a CRC-32 in your browser
The CRC32 Checksum Calculator calculates both CRC-32 and Adler-32 locally in your browser.
- Open the CRC32 Checksum Calculator.
- For text, stay on the Text tab and type or paste into Text (hashed as UTF-8). The checksums update as you type.
- For a file, switch to the File tab and drop a file, or click to choose one. Files of any size are read in chunks, with a progress indicator, so even multi-gigabyte files never need to fit in memory.
- Read the results for CRC-32 and Adler-32, shown in hex and as unsigned decimal numbers, each with a copy button. Switch on Uppercase hex if your reference value uses capital letters.
- Paste the published value into Expected checksum to compare (hex or decimal, optional) to have a matching result highlighted.
Because the file never leaves your computer, this also works for private backups and large media files that would be slow to upload.
Other ways to calculate CRC-32
Python has CRC-32 and Adler-32 in the standard library:
import zlib
with open("backup.zip", "rb") as f:
crc = 0
while chunk := f.read(1 << 20):
crc = zlib.crc32(chunk, crc)
print(format(crc, "08x"))
Passing the previous value as the second argument lets you process a large file in chunks.
Node.js added zlib.crc32() in recent releases (it exists in Node 22 and in later Node 20 updates). On older versions, use the small function above or a package from npm.
Archive tools. 7-Zip on Windows can show CRC checksums from the context menu, and unzip -v lists the stored CRC-32 of each file in a ZIP archive, which is handy for comparing against a freshly calculated value.
Windows PowerShell's Get-FileHash offers SHA and MD5 algorithms but not CRC-32, so use one of the other options there.
Troubleshooting mismatches
Text checksums differ between tools
Text must be turned into bytes before hashing. Different encodings (UTF-8 versus UTF-16) or line endings (\n versus \r\n) produce different bytes and different checksums. A trailing newline added by an editor or echo is a classic cause.
Hex looks different but might be the same
414FA339 and 414fa339 are the same value. So is the decimal 1095738169. Leading zeros are sometimes dropped: 0a1b2c3d and a1b2c3d are equal as numbers.
A different CRC-32 variant
If every one of your values disagrees with a published list, the publisher may use another variant, such as CRC-32C (Castagnoli), which is used in some storage and network protocols. Check which algorithm they specify.
ZIP says "CRC error"
The file inside the archive was damaged or the download was incomplete. Download it again, ideally checking a SHA-256 hash if the publisher provides one.
To convert checksums between hex and decimal by hand, the Number Base Converter is useful.
Frequently asked questions
What is CRC32 used for?
Detecting accidental data corruption. It is built into ZIP, gzip, PNG and Ethernet, and is commonly published alongside downloads as a quick integrity check.
Is CRC32 secure?
No. It is easy to create a modified file with the same CRC-32. Use SHA-256 to protect against deliberate tampering.
Can two different files have the same CRC32?
Yes. With only about four billion possible values, collisions are inevitable across many files. For a single file, accidental corruption going unnoticed is very unlikely.
What is the difference between CRC32 and Adler-32?
Both produce 32-bit values. Adler-32 is simpler and faster but weaker, especially for short inputs. CRC-32 has stronger error-detection guarantees.
Why is my CRC32 different from the one on the website?
The usual causes are a corrupted or incomplete download, a different text encoding or line ending, or a publisher using another CRC variant such as CRC-32C.