Cyclic Redundancy Check

The message to send · 1–64 bits
2–17 bits · starts and ends with 1
Try:
Use 0s and 1s. Spaces are ignored; leading zeros are kept.Both ends use the same generator.

1 · Original data

2 · Append zeros

3 · CRC remainder

Append zeros, then divide

Using generator

XOR long division

Use XOR; there is no borrowing.

A teal digit is brought down from the original dividend. Leading zeros stay visible to show the alignment.

Original dataCRC bits

Worked division table · all steps

Select a step number to inspect that operation in the drawing above. On the last row, the remaining bits are the remainder.

StepCurrent bitsXOR withXOR resultBring downNext bits / remainder
Why does this work?

The sender: a generator with r + 1 bits needs r check bits. Append r zeros to the data, divide using XOR, and replace those zeros with the remainder. The resulting frame divides evenly by the generator.

The receiver: divide the entire received frame by the same generator. Do not append extra zeros. A nonzero remainder detects an error; a zero remainder means no error was detected.

CRC does not correct errors. A zero remainder can also occur for some changed frames. The undetected example demonstrates this limitation.

Generator as a polynomial

Each 1 includes a power of x; each 0 omits it. The leftmost bit gives the highest power.