What Is a CRC Error? The Check That Catches Corrupted Data

You drag a folder off an external drive and the copy stops halfway. Windows puts up a small window: “Data error (cyclic redundancy check).” The folder stays where it was, and the message says nothing about what broke.

The same three letters turn up in other places. A ZIP file refuses to open with a CRC error. A switch port’s error counter climbs by one for every frame it throws away. A download fails its check and starts over.

In every case the message means one thing: the data that arrived differs from the data that was sent, and the check caught the difference. That is the good news hiding inside an annoying message. What you do next depends on where you saw it. The check itself comes first, then each place it appears, and the cheap tests that sort a dying drive from a bad cable.

What a CRC error is?

A cyclic redundancy check, CRC for short, is a short value computed from a block of data and sent or stored with it. The check value works like a fingerprint of the data. Change one bit anywhere in the block and the fingerprint changes with it.

The sender runs the data through a fixed formula and gets a short number, the check value. That number travels with the data. The receiver runs the same formula over the data it got and compares its answer with the number that arrived. If the two match, the data is accepted. If they differ, the receiver knows the data changed on the way, and that mismatch is a CRC error.

Two details matter. First, the check value is computed from the data itself, so it carries no extra information about the message. It is pure redundancy, extra bits whose only job is verification. Second, the check answers one question only: whether this arrived intact. It says nothing about what the data means, and it cannot repair what broke.

How the check is computed?

The formula is a division, but not the kind you learned in school. The message is treated as one long number in binary code, the generator polynomial is the divisor, and the remainder is the check value. All the arithmetic runs in GF(2), a system with only the digits 0 and 1, where addition and subtraction are both XOR: 1 plus 1 is 0, with no carry to pass along.

Why divide the whole codeword at all? Comparing two numbers works too. The division is the shortcut: it gives a fixed constant, the residue, so receiver hardware checks one value and never stores the sender’s number for comparison. For the standard CRC-32 that constant is 0x2144DF1C, the same for every message.

A small example shows the whole mechanism. Take the message 11010011101100 and the generator 1011, a 3-bit CRC. Three zeros are appended to the message to make room for the remainder, then the generator divides the result with XOR at each step. The remainder is 100.

A worked 3-bit cyclic redundancy check: message 11010011101100 with generator 1011 leaves remainder 100, and the receiver dividing the full codeword gets remainder 000

That remainder is appended to the message, and the 17 bits 11010011101100 100 go out on the wire. The receiver divides everything it got by the same generator. A remainder of 000 means the frame arrived intact, at least as far as this check can tell. A nonzero remainder means something changed, and the frame is rejected. Scale that idea to 32 bits and you have the CRC on Ethernet frames and ZIP files.

The live test

Hand arithmetic proves the method on paper. The test below runs it for real, in Python, on a message you can check yourself. The bit-flip run is the part I trust most, because it is the only part I ran twice with two different routines and got the same answer both times.

MessageWhat changedCRC-32Result
“Valley AI” as sentNothing0x51EAB37CAccepted
One bit flipped, V to WLowest bit of the first byte0x4691A73FMismatch, error detected
One bit flipped in the check valueLast bit of 0x51EAB37C0x51EAB37D vs 0x51EAB37CMismatch, error detected
One whole byte flippedAll 8 bits of the fourth byte0xB52E18B0Mismatch, burst caught

For this run, every CRC value here came out of Python 3.12.3, checked a second time against the published check values for “123456789”. All three matched exactly.

Running the check costs almost nothing. The speed comes from how a CPU works. The XOR and shift steps map directly onto instructions the processor runs in a handful of cycles. That is why the check rides on nearly every frame and file. That CRC-32 seals files you handle every day. A ZIP archive stores one beside each file inside it, and a small ZIP written for the test carries a stored value that matched the freshly computed one exactly.

What a CRC catches, and what slips past

Error patternDoes CRC-32 catch it?
Any single-bit errorAlways
Any two-bit errorAlways
Any odd number of bit errorsAlways, when the generator carries an (x+1) factor
Any burst of 32 bits or shorterAlways
Any burst longer than 32 bitsAlmost always: about 1 in 4.29 billion slips through
A frame that never arrivesNever: no check can catch a frame that does not show up

Nobody measured the 1-in-4.29-billion figure. It is arithmetic: 2 to the power of -32. The figure says how the odds scale, and the scaling is what makes a 32-bit check repay its 4 bytes.

If a CRC catches nearly everything, why “nearly”? Because the check is a remainder, and remainders repeat. An error pattern that happens to be a multiple of the generator divides cleanly, and the receiver sees a remainder of zero over damaged data.

That hole is not theoretical. With the small 3-bit CRC from the worked example, an error pattern equal to the generator itself flips 3 bits in the codeword, and the receiver still reads a remainder of 000. The frame is accepted with three bits wrong. CRC-32 carries that hole as well. It only needs an error pattern 32 bits long that matches the generator, which random noise essentially never produces. Random damage is caught. Damage shaped to fit the generator is not, and that is why a CRC is an error check, not a seal against tampering.

Frame length changes the protection. Philip Koopman’s exhaustive search of 32-bit polynomials found the standard Ethernet CRC-32 holds a Hamming distance of 6 out to 268 bits of data, but only 4 out to 91,607 bits. The polynomial and the code stay the same; the protection changes with frame length. A single parity bit, by comparison, catches only odd numbers of errors and says nothing about bursts, which is why no serious link relies on parity alone.

CRC-32, CRC-16, and CRC-32C

CheckWidthPolynomialCheck value for “123456789”Where you meet it
CRC-3232 bits0x04C11DB70xCBF43926Ethernet, ZIP, PNG, gzip
CRC-16/CCITT-FALSE16 bits0x10210x29B1Serial protocols
CRC-16/MODBUS16 bits0x8005 (reflected 0xA001)0x4B37Modbus RTU industrial links
CRC-32C32 bits0x1EDC6F410xE3069283iSCSI storage

Five parameters make a full CRC, and the polynomial is only one of them. A full CRC needs the polynomial, whether the input bits are reflected, whether the output is reflected, the starting value of the register, and the final XOR. Two implementations can share a polynomial and agree on nothing. That is why the check values in the table exist: run your code against them before you trust it against a device.

Every check value in the table is written in hexadecimal, the base-16 shorthand computers use for values humans have to read. The width is the trade: 16 bits cost 2 bytes and catch less, 32 bits cost 4 and catch far more, and the choice follows the damage the channel produces.

Where you meet a CRC?

Older than the web and wider than networking, the check rides anywhere a block of data crosses a boundary it cannot trust.

  • Ethernet frames: the last 4 bytes carry the CRC-32, called the frame check sequence. A switch discards a failed frame and ticks its CRC error counter.
  • ZIP, PNG, and gzip files: the same CRC-32 seals each file’s payload. A bad download fails its check instead of handing you a broken file.
  • Storage: drives check blocks on read. A mismatch there produces the Windows message: data error, cyclic redundancy check.
  • Serial and industrial links: Modbus RTU ends its frames in two CRC bytes, and CAN bus frames carry a 15-bit CRC checked in silicon.
  • Firmware: release images record a CRC-32 in the build record. A wrong version fails the check before it runs.

No picture shows the idea more clearly than the Ethernet frame. The full story of the frame, its addresses, and its length field is in how Ethernet works.

An Ethernet frame diagram showing destination, source, length, payload, and the frame check sequence carrying the CRC-32 as the last 4 bytes

A failed frame is not repaired in place. TCP asks the sender for the frame again, which is one of the ways TCP vs UDP differ: UDP leaves the decision to the application. On a disk, the idea sits one layer down: a file system checks each block it reads, and a mismatch there is what Windows reports as a data error.

The Windows drive error

On a drive, the message means Windows read a block back and its recomputed check disagreed with the stored one. The data that came back is not the data that was written. The cause is one of three things: a few bad spots on the disk, a cable or port losing bits on the way, or a drive starting to fail.

Should you run CHKDSK first? No. Copy first, repair second. A drive that throws this error may be on its way out, and every repair attempt makes it work harder. Copy what you can off it before anything writes to it.

When the error appearsMost likely causeFirst step
Copying files, always at the same one or two filesA few bad spots on the diskCopy around them with robocopy, then scan
Opening an external drive, “not accessible”Cable, port, or damaged file systemSwap the cable and port first
Random files, different ones each timeCable, port, or the drive’s electronicsSwap cable and port, test on another machine
Initializing a disk in Disk ManagementThe drive itself, usually beyond repairStop and consider a recovery lab

One command does the rescue. Open Terminal as administrator and run this line, replacing E: with the failing drive: robocopy E:\ D:\Rescue /E /R:1 /W:1 /XJ. It skips what it cannot read and keeps going, so you end up with everything else. The robocopy-first rule is the one I would not trade for a faster repair, because a repair that writes to a dying drive can finish what the failure started.

Only after the copy is safe does CHKDSK earn its turn: chkdsk E: /f /r. The bad spots are physical damage, and how a hard drive works explains why: bits live as magnetic patterns on spinning platters, and a spot that can no longer hold its pattern fails its check on read. If the drive clicks, disconnects, or reports the wrong capacity, stop. No software fixes failed heads.

What a CRC cannot do?

A CRC tells you a frame is bad. It does not tell you which bit is bad, it cannot fix the bit, and it does nothing about a frame that never arrives. Detection is the whole job, and correction belongs to other codes or to a re-send.

Security is a separate matter. The operation is linear over GF(2), so anyone who can flip message bits can flip the check bits to match. Forging a frame with a valid CRC is an algebra exercise. If tampering is in your threat model, you want a cryptographic hash or a message authentication code. A CRC will not do that job.

January 1961 is the method’s birthday: W. Wesley Peterson and D. T. Brown published “Cyclic Codes for Error Detection.” Sixty-five years on, the same division still runs on every Ethernet port, in every ZIP file, and on every drive that reports a CRC error.

If a CRC error appears on your screen, run the cheap checks first. Re-download the file or re-copy it first: it costs nothing and it settles the question. Swap the cable and the port if a drive is involved. Only when the error survives a clean copy and a known-good cable is the hardware itself the suspect, and at that point the copy you made first is the one that matters.

Frequently asked questions about CRC errors

How is a CRC different from a checksum?

A checksum is any short value computed from data to check it, and the simplest ones are sums: add the bytes and keep the total. A CRC is one specific kind of checksum, and the difference is the math. A sum cannot see order, so swapping two bytes leaves it unchanged. A CRC divides the message as a polynomial, so every bit’s position feeds the result, and that is what buys the burst guarantees. Every CRC is a checksum. Most checksums are not CRCs.

Why does a download fail with a CRC error once and work on the second try?

Most failures are transient: a burst of noise on the line, a hiccup in the drive’s read, or a packet that arrived damaged. The check catches the damage, the transfer is retried, and the second copy arrives clean. A failure that repeats on every try points somewhere else: a bad sector the drive keeps hitting, a cable that keeps dropping bits, or a source file that is itself damaged.

Does a CRC error mean the original file is damaged?

Not usually. The error says the copy that arrived failed its check. The original on the source disk is often intact, and a fresh copy from the same source proves it: if the second copy reads clean, the original was fine and the first transfer was the casualty. If every copy from that source fails at the same file, the damage sits in the stored original, and that is when the rescue copy matters.

What is the difference between CRC-32 and CRC-32C?

They are two different 32-bit checks with different generator polynomials. CRC-32 uses 0x04C11DB7, chosen in 1975 for the Air Force’s AUTODIN-II effort. CRC-32C uses 0x1EDC6F41, found in a 1993 search by Guy Castagnoli and colleagues for polynomials that catch more errors at the block sizes storage uses. iSCSI specifies CRC-32C as its data digest in RFC 3720, and modern x86 processors carry a dedicated instruction for it. The width and the idea are the same; the polynomial and the trade are different.

Why does Windows call it a ‘data error’?

Windows reports the I/O failure in its own words. The message ‘Data error (cyclic redundancy check)’ is the full text: the ‘data error’ part is the generic I/O failure, and the parenthetical names the check that caught it. Disk tools and switch ports use the shorter forms, ‘CRC error’ or ‘FCS error’, for the same event.

Do SSDs use CRCs too?

Yes, at more than one layer. SATA and NVMe links carry CRCs over the data moving between the drive and the host, so a bad cable or a noisy link fails its check the same way an Ethernet frame does. Inside the drive, the controller checks blocks as it reads them and retires ones that stop passing. The Windows message looks the same either way, so the cause cannot be read off the message alone.

user profile reference
Kaleem
Computer, AI and Web Technology Specialist | Web | + posts

Kaleem is a Computer Science graduate (Virtual University of Pakistan) and the founder and editor of Valley AI, where he publishes in-depth, tested guides on computer hardware, artificial intelligence, and how the internet works. Every guide is researched from primary sources, tested hands-on where possible, and updated when the facts change.

Leave a Comment