CRC32 Checksum

Turn a piece of text or a file into an eight-character hexadecimal number, then compare it with the value you were given. CRC32 answers exactly one question: did any byte change on the way here? It cannot stop deliberate tampering, and it must not be used as a cryptographic digest — for that, go to Hash Calculator.

CRC32
—
Lowercase, eight characters. Computed over UTF-8 bytes.
Size
—bytes

—

—

What CRC32 can and cannot tell you

It tells you whether a byte changed while the data was copied or transmitted. It does not tell you whether this is the file you wanted — CRC32 is linear, so constructing two different files with the same CRC32 is easy, and at only 32 bits the odds of an accidental collision between unrelated files are not zero either. Use it for integrity checks; use SHA-256 for provenance and tamper detection.

It hashes bytes, not characters

In UTF-8 a Chinese character takes three bytes; in GBK, two — the same text produces completely different CRCs under different encodings. This page always uses UTF-8 (the modern default), so a mismatch against a value computed on a GBK system is expected, not an error by either side. Files do not have this problem: a file is already bytes.

Which CRC32 this page uses

There are several parameter sets under that name. This page uses the most common one: polynomial 0xEDB88320 (reflected), initial value 0xFFFFFFFF, final XOR, lowercase eight-digit output — the CRC32 found in zlib, PNG and ZIP. Standard check value: feed it 123456789 and you should get cbf43926.

Questions

How is CRC32 different from MD5 or SHA-256?

Different jobs. CRC32 is 32 bits and built to detect transmission errors; it is very fast and shows up in archives, PNG and network protocols. MD5 (128-bit) and SHA-256 (256-bit) are built to detect tampering and are slower. For "did the download arrive intact", CRC32 is enough; for "did someone modify this", use SHA-256.

Why does my value not match the one this page computes?

Most likely first: (1) different text encoding — UTF-8 versus GBK gives completely different results; (2) a trailing newline crept in (many editors add one on save); (3) the other side used different parameters (uppercase output, no zero padding, a different initial value); (4) it is a different file. For files, select the file rather than pasting text.

Does the file get uploaded anywhere?

No. The browser reads it locally (File.arrayBuffer()) and CRC32 is computed on this page — there is not a single network request. It works offline; you can disconnect and try.

How large a file can it handle?

The limit here is 128 MB. Not because the algorithm is slow (CRC32 handles hundreds of MB per second), but because the whole file has to fit in memory — beyond that the browser will stutter or crash. For bigger files use cksum or your system’s hash command.

Mouse repair

QR codeWeChat
淘宝店铺二维码淘宝店铺

Mouse acting up? Get in touch.

Repair