Cyclic Redundancy Check Explained: How Data Proves It Arrived Intact

Cyclic redundancy check explained in plain terms means understanding how a few extra bits can prove that a file, a packet, or a disk block arrived exactly as it was sent. The central question is how a receiver can tell whether data was corrupted in transit without seeing the original, and the answer is a checksum: a short value computed from the data itself, sent alongside it, and recomputed on arrival to see whether the two match.

A cyclic redundancy check, usually called a CRC, is an error-detecting code that treats a block of data as a large number, divides it by a fixed polynomial, and appends the remainder to the data. The receiver repeats the division, and if the remainder is not zero, something changed along the way.

The idea is simple: the sender does a little arithmetic, the receiver repeats it, and any mismatch means the data cannot be trusted. This article explains what a CRC is, how it works, and where it is used.

Key takeaways

  • A CRC is a short checksum that detects accidental changes to data.
  • It treats the data as a number and divides it by a fixed polynomial.
  • The remainder is sent with the data and checked again on arrival.
  • It catches burst errors and single-bit flips with very high probability.
  • It detects errors but cannot fix them; the data must be sent again.

What a cyclic redundancy check is

A CRC is computed by viewing a message as a binary polynomial, where each bit is a coefficient, and dividing it by a generator polynomial agreed in advance. The remainder of that division, which is shorter than the generator, is the check value, and it is appended to the message before the message is stored or sent.

The check is powerful because the arithmetic is done modulo two, which means addition is exclusive-or and there are no carries to complicate things. A single flipped bit changes the remainder, and so does any burst of consecutive flipped bits shorter than the length of the check value, which is why CRCs catch the kinds of damage that real hardware actually produces.

CRCs were introduced by W. Wesley Peterson in 1961, and they spread quickly because the arithmetic is cheap to build in hardware. A CRC circuit is little more than a shift register with a few exclusive-or gates, so it can run at line speed on a network card or a disk controller without slowing anything down. Our guide to hashing explains a related way of summarising data, and our guide to RAID explains the storage systems that rely on checks like these.

How a cyclic redundancy check works

Computing a CRC starts with the message and a chosen generator polynomial, such as the one behind CRC-32, which is 33 bits long and produces a 32-bit check value. The message is shifted left by the length of the check value, which makes room for the remainder, and then divided by the generator using modulo-two arithmetic.

The division proceeds bit by bit, much like long division on paper, except that subtraction is exclusive-or. Whenever the leading bit of the working value is one, the generator is exclusive-ored into it; whenever it is zero, the value is simply shifted. What is left when the whole message has been processed is the remainder, and that remainder is the CRC.

Checking a received message is the same process run in reverse. The receiver takes the message with its appended check value and divides the whole thing by the same generator, and if the data is intact, the remainder is zero. A non-zero remainder means the data changed, and the receiver knows to ask for it again or to report an error.

The choice of generator matters. Different polynomials catch different error patterns, and the well-known ones, like CRC-32, were chosen because they catch every burst error up to 32 bits long and every odd number of bit errors. Shorter checks, like CRC-8 or CRC-16, are used where space is tight, such as in small embedded devices, and they trade a little detection power for a shorter check value.

The CRC itself carries no information about what went wrong. It can say that an error happened, and in a few special cases it can narrow down where, but it cannot reconstruct the original data. That is the line between error detection and error correction: a CRC is a smoke alarm, not a fire extinguisher, and fixing the damage is someone else’s job.

A dark data centre with a glowing green strip of checksum data running across rows of drives, one drive lit red where a changed byte was caught
A dark data centre with a glowing green strip of checksum data running across rows of drives, one drive lit red where a changed byte was caught, shows how a cyclic redundancy check works: compute, compare, and reject anything that does not match.

Comparing a cyclic redundancy check with other error checks

A CRC is one of several ways to check data, and each was built with a different emphasis. A simple checksum adds bytes together and is cheap but weak, a parity bit catches single flips and nothing more, and a cryptographic hash catches everything but costs far more to compute, and each approach trades strength for speed in a different way.

The table below sets out the main contrasts between the leading approaches.

Aspect CRC Simple checksum Cryptographic hash
What it catches Bursts and most multi-bit errors Some single-bit errors Any change, however small
Cost to compute Very low, hardware friendly Trivial High, by design
Protects against Accidental corruption Accidental corruption Deliberate tampering
Can fix errors No, detection only No, detection only No, detection only
Best for Networks, files, and storage Tiny embedded frames Security and integrity proofs

The practical result is that a CRC is the right default wherever accidental damage is the threat, a simple checksum suits the smallest frames, and a cryptographic hash is needed only when someone might be tampering on purpose.

Where cyclic redundancy checks are used

Ethernet uses CRC-32 on every frame. The frame check sequence at the end of each packet lets a network card reject a damaged frame in hardware, before it ever reaches the operating system, which is why a noisy cable causes retransmissions rather than corrupted downloads.

File formats use CRCs to guard their contents. ZIP archives store a CRC-32 for every file, so an unpacking tool can tell whether a file was damaged inside the archive, and the PNG image format stores a CRC for every chunk, so a viewer can spot a truncated or corrupted image before displaying it.

Storage systems use CRCs to protect data at rest. A disk controller computes a CRC when it writes a sector and checks it when it reads the sector back, and a mismatch means the sector is unreadable and must be rebuilt from a redundant copy, which is how a failing drive is caught before it silently returns bad data.

Communication protocols use CRCs on the wire. The Modbus protocol, used in industrial control, appends a CRC-16 to every message, and Bluetooth and USB both use CRCs on their packets, because a radio link or a cable is exactly the place where bits get flipped.

Embedded devices use short CRCs in firmware updates. A microcontroller checks the CRC of a new firmware image before it installs it, so a download interrupted halfway through cannot brick the device, and a single flipped bit in the image is caught before a single byte is written to flash.

Strengths and limits

The greatest strength of a CRC is its cost. The arithmetic is so cheap that it runs in hardware at full line speed, which means every frame, sector, and packet can be checked without any measurable slowdown, and that ubiquity is the reason corrupted data is rare rather than routine.

It is also a strength that a CRC catches exactly the errors that happen in practice. Burst errors from a noisy channel, single-bit flips from a failing cell, and the damage from a truncated transfer are all caught with near certainty, which is why engineers trust CRCs in places where a missed error would be expensive.

The limits are real, though. A CRC cannot detect a deliberate change made by someone who knows the generator, because the attacker can simply recompute the check value, and it cannot fix anything it finds. For tamper-proofing, a cryptographic signature is needed, and for correction, an error-correcting code is needed.

Cyclic redundancy check checklist

  • Use a CRC wherever data crosses a wire, a disk, or a radio link.
  • Pick CRC-32 for files and networks unless space forces a shorter check.
  • Agree the generator polynomial on both ends before anything is sent.
  • Check the CRC in hardware where possible, so nothing slows down.
  • Reject and retransmit on a mismatch; never trust a failed check.
  • Do not use a CRC where tampering is the threat; use a hash instead.
  • Remember a CRC detects errors but cannot correct them.
  • Test with corrupted data to confirm the check actually fires.
  • Combine a CRC with redundancy when a retry is not possible.

Frequently asked questions

What is a cyclic redundancy check in simple terms?

It is a short checksum computed from data by polynomial division, sent with the data, and recomputed on arrival to prove nothing changed in between.

What is the difference between a CRC and a checksum?

A checksum usually adds bytes together, which misses many errors, while a CRC divides by a polynomial, which catches burst errors and almost every multi-bit error.

Can a CRC fix a corrupted file?

No. It can only detect that corruption happened, and the damaged data must be sent again or rebuilt from a redundant copy.

Why is CRC-32 so common?

Because its 32-bit check value catches every burst error up to 32 bits long, it is cheap to compute in hardware, and it is the standard for Ethernet, ZIP, and PNG.

Can a CRC be fooled?

Yes, by anyone who knows the generator polynomial, because they can recompute a valid check value for altered data, which is why CRCs protect against accidents, not attackers.

When should I not use a CRC?

When the data must survive tampering, where a cryptographic hash is needed, or when errors must be corrected on the spot, where an error-correcting code is the right tool.

The bottom line

Cyclic redundancy check explained in one line is this: divide the data by a fixed polynomial, send the remainder with it, and reject anything that does not divide cleanly on arrival.

It is the quiet arithmetic behind almost every file, packet, and disk block that arrives intact, and the reason a flipped bit is caught in microseconds rather than discovered months later.

This article is general information about how cyclic redundancy checks work, not advice about choosing error detection for a particular system.

Latest articles

Scroll to Top