bitlvl
EN

CRC & checksum calculator

Type text, paste hex bytes or drop a file and get every common CRC at once, each with its parameters, so you can find the variant a device or protocol is using.

Or drop a file, or

Custom CRC model

Reflect

What a CRC is

A cyclic redundancy check treats the message as one long binary number and divides it by a fixed polynomial; the remainder is the checksum. Flip any single bit, or any burst of bits shorter than the CRC, and the remainder changes, which is why CRCs guard Ethernet frames, ZIP entries, PNG chunks, disk sectors and serial protocols. They are fast in hardware and software, but they are not cryptographic: anyone can craft data with a chosen CRC.

Why there are so many “CRC-16”s

Two implementations of the same width can differ in five parameters, and each combination is a different checksum:

ParameterMeaning
PolynomialThe divisor, written without its top bit (0x1021 for CCITT, 0x04C11DB7 for CRC-32).
InitThe register's starting value, 0 or all ones.
Reflect inWhether each input byte is processed least-significant bit first (true for CRC-32, MODBUS; false for CCITT-FALSE, XMODEM).
Reflect outWhether the final register is bit-reversed.
XOR outA final XOR, usually 0 or all ones.

The standard way to identify a variant is its check value: the CRC of the ASCII string 123456789. The table above shows it for every model, and the default input is exactly that string, so if a device gives you a checksum for a known payload you can match it against all variants at once.

Common choices

  • CRC-32 (0x04C11DB7, reflected): Ethernet, ZIP, gzip, PNG, zlib.crc32, cksum -o 3.
  • CRC-32C (Castagnoli): iSCSI, SCTP, ext4 metadata, Btrfs, LevelDB; has a hardware instruction on x86 and ARM, so it is the fast choice for new designs.
  • CRC-16/MODBUS: Modbus RTU over serial; CRC-16/CCITT-FALSE: Bluetooth, many “CRC-CCITT” claims; CRC-16/XMODEM: XMODEM, Python binascii.crc_hqx.
  • Adler-32: zlib streams; faster than CRC but weaker for short inputs.

Questions

Is a CRC the same as a hash?

No. A CRC detects accidental corruption and can be reversed or forged trivially. For integrity against an attacker, or for identifying files, use SHA-256. For speed on a trusted channel, CRC is fine.

My device gives a different CRC-16 than this page.

There are at least a dozen CRC-16 variants. Enter the payload the device checksummed and compare its value against every row in the table; the matching row tells you the polynomial, init and reflection the device uses. If none matches, try the custom model and check whether the device includes a length byte or address in the data.

Which byte order does the result have?

The CRC is shown as a number. When it is written into a packet, the protocol decides the order: MODBUS sends the low byte first, XMODEM the high byte first. Check the specification or an example frame.

What is CRC-32C and why do databases use it?

CRC-32 with the Castagnoli polynomial, which has better error-detection properties for the block sizes storage systems use and is implemented as a single CPU instruction (SSE4.2 crc32, ARMv8 CRC32C), making it several times faster than the classic CRC-32.

Can I compute a CRC incrementally?

Yes. All these CRCs can be continued from a previous value, which is how zlib.crc32(data, previous) works. This page computes the whole input at once.