CRC Calculator — CRC-8, CRC-16 and CRC-32

CRC-8, CRC-16 (CCITT, Modbus, XMODEM) and CRC-32 over hex or ASCII input, with the polynomial and shift steps explained.

Example: The CRC-32 (zlib / PKZIP) of 9 bytes is 0xCBF43926.

Check it against real silicon

Chiprun runs your firmware on an emulated microcontroller and hands back the UART output, so you can confirm these numbers rather than trusting them.

Chiprun docs

Formula

shift left, XOR the polynomial whenever the top bit was set

Worked example

The CRC-32 (zlib / PKZIP) of 9 bytes is 0xCBF43926.

  1. register = init

    register = 0xFFFFFFFF

    0xFFFFFFFF

  2. for each byte: XOR in, then shift 8 times

    polynomial 0x04C11DB7, input reflected

    9 bytes processed

    On each shift, if the bit shifted out was 1, XOR the polynomial back in.

  3. result = reflect(register) XOR xorOut

    reflected, XOR 0xFFFFFFFF

    0xCBF43926

Frequently asked questions

Why do two CRC calculators give different answers for the same data?

Because 'CRC-16' is not one algorithm. The same polynomial with a different initial value, or with the input bits reflected, produces a completely different result. CRC-16/MODBUS and CRC-16/ARC share a polynomial and still disagree. Always match the variant, not just the width.

What is the check value for?

It is the CRC of the ASCII string “123456789”, published for every standard variant. Running your own implementation against it is the fastest way to confirm you have the polynomial, initial value, reflection and final XOR all correct.

My CRC matches this tool but the device still rejects my frame.

Almost always byte order or coverage. Modbus RTU sends the CRC low byte first, which looks backwards next to the written value. And protocols differ on which fields are inside the checksummed range — the address and function bytes usually are.

Does a CRC protect against tampering?

No. A CRC detects accidental corruption — noise, bit flips, truncation — and is very good at it. It offers no protection against deliberate modification, because anyone can recompute it. For that you need a MAC or a signature.

Related tools