Lightly scratch a CD and it will still play flawlessly, in a way that a vinyl record cannot. Smudge a QR code, or cover part of it with a logo, and your phone will usually still read it. Pull a dead drive out of a well-built server and not a single file goes missing. These are three different technologies, designed for very different purposes, but they survive damage the same way: by doing arithmetic on a set of just 256 numbers, in which you can add, subtract, multiply, and even divide without ever running off the end.
That last part is harder than it sounds. A byte, the basic unit of computer memory, holds one of 256 values, from 0 to 255. Ordinary arithmetic doesn’t respect that limit. Add 200 and 100 and you get 300, which no longer fits. The kind of arithmetic that never overflows, and still allows division, has a name. It’s called a Galois field, after the young Frenchman who first described it nearly two centuries ago. He never saw a computer, nor even his 21st birthday.
Arithmetic that wraps around
Most of us already know one kind of arithmetic that wraps around: the clock. Nine o’clock plus five hours is two o’clock, not 14. Mathematicians call this modular arithmetic, and it lets you add, subtract, and multiply forever without leaving the numbers on the dial.
Division is another matter. On a 12-hour clock, 3 times 4 is 12, which is the same as 0. That’s a problem. In ordinary arithmetic, two numbers that aren’t zero can never multiply to zero, and division depends on that rule. On the clock, there’s no number you can multiply by 3 to get 1, so you can’t divide by 3 at all.
The fix is to use a clock with a prime number of hours. Add a single hour to the dial, making it 13, and every number except 0 has a partner it multiplies with to make 1: 2 times 7 is 14, which wraps around to 1, and 3 times 9 is 27, which goes around the dial twice and also lands on 1. (Two numbers are their own partners: 1 times 1 is 1, and 12 times 12 is 144, which also wraps around to 1.) Dividing by 3 is just multiplying by its partner, 9.1 With a prime, all four operations work, every answer lands back on the dial, and nothing ever overflows. A finite set of numbers that behaves this way is a Galois field.
Why 256 is harder than 13
Computers, unfortunately, don’t want 13 numbers. They want 256, one for each possible byte value, and 256 isn’t prime. On a 256-hour clock, division breaks down just as it does on the 12-hour one: 2 times 128 is 256, which wraps around to 0.
The way around this is one of the cleverer ideas in mathematics. Instead of treating a byte as a number, treat its eight bits as the coefficients of a polynomial, in which every coefficient is either 0 or 1. The byte 11001000, which represents the decimal number 200, becomes 1x7 + 1x6 + 0x5 + 0x4 + 1x3 + 0x2 + 0x + 0, or simply x7 + x6 + x3. Adding two bytes then becomes a simple bit-by-bit operation that computers do instantly, called exclusive or, or XOR: each bit of the answer is 1 if exactly one of the two bits is 1. In this world, 200 plus 100 is 172, and every number is its own negative, so subtraction and addition are the same thing.
Multiplying bytes means multiplying their polynomials. When the result grows past eight bits, it’s wrapped around, just like the clock, by dividing by a fixed polynomial and keeping the remainder. The divisor plays the role of the prime number: it has to be a polynomial that can’t be factored, one that is, in effect, prime. QR codes use x8 + x4 + x3 + x2 + 1.2 With that rule, 2 times 128 is no longer 0. It’s 29.
The result is a field of exactly 256 elements, written GF(28): two possible values for each of a byte’s eight bits, and 28, or 2 multiplied by itself eight times, is 256. GF stands for Galois field. Every byte has a partner it multiplies with to make 1, every calculation produces another byte, and division always works. It’s a little universe of arithmetic that fits perfectly inside one unit of a computer’s memory.
I took a course in this kind of mathematics in college, and I ended up dropping it. At the time, it was all purely theoretical to me, with no practical applications in sight, and I wasn’t motivated or focused enough to master it. Had I appreciated then what I appreciate now about its practical significance, I might have treated the subject differently.
Fixing errors with a curve
Why would anyone need to divide bytes? The answer came in 1960, when two mathematicians at MIT’s Lincoln Laboratory, Irving Reed and Gustave Solomon, published a five-page paper with the unpromising title “Polynomial Codes over Certain Finite Fields.”3
Their idea rests on a fact most of us learned in school: two points determine a line, three points determine a curve shaped like a parabola, and in general, any curve of a given complexity is fixed by a certain number of points. Reed and Solomon treated a message as the description of such a curve. To send it, you don’t send the message itself; you send points on the curve, more of them than you strictly need. If some get lost or garbled along the way, the ones that survive are still enough to rebuild the curve, and with it the message.
To find the curve that passes through a set of points, you have to solve equations, and solving equations takes division. Doing that in ordinary arithmetic would produce fractions and numbers too large to store. Doing it in a Galois field keeps every value a legal byte. That is why Reed–Solomon codes, as they came to be called, need the field: it lets a computer do algebra on bytes without anything spilling over.
The codes were ahead of their time. Practical methods for decoding them weren’t developed until 1968, and the hardware to run them fast enough came later still.4 But once it did, Reed–Solomon codes turned up nearly everywhere. They let compact discs, commercialized in 1982, play through scratches and fingerprints.5 Voyager 2 carried a Reed–Solomon encoder from launch in 1977, and the codes were put to work upon its 1986 flyby of Uranus, helping it send back clear pictures of Uranus and Neptune from billions of miles away.6 They protect data from the Hubble Space Telescope, from DVDs and hard drives, and, as I wrote in my essay on QR codes, they are why a QR code with nearly a third of its data damaged can still be read.7
The server that can lose two drives
The same arithmetic does its most visible work in the disk arrays that store data in offices and data centers, a technology called RAID.
The simplest version needs only the smallest field there is, GF(2), whose two elements, 0 and 1, are the same ones that serve as the coefficients of each byte’s polynomial. Its addition is XOR. Suppose three drives hold the bytes 5, 9, and 3. A fourth drive stores their sum, which in XOR arithmetic is 15. If the drive holding 9 fails, you add up everything that survives, 5 plus 3 plus 15, and get 9 back. That scheme, known as RAID 5, can survive the loss of any one drive.
Losing a second drive before the first is replaced would be fatal, and with today’s enormous drives, which take many hours to rebuild, that is a real risk. RAID 6 guards against it by adding a second parity drive. Its contents are computed with multiplication in GF(28), each data drive weighted by a different element of the field. With two independent equations, the array can solve for two missing drives at once. The Linux operating system’s RAID 6 software uses the same polynomial as QR codes.8
The field turns up in still more places. The encryption standard that protects much of the world’s online traffic, AES, does part of its scrambling with multiplication in GF(28), though it uses a different polynomial, x8 + x4 + x3 + x + 1.9 Much of the digital world, it turns out, runs on the arithmetic of a 256-hour clock.
The man who didn’t live to see any of it
Évariste Galois (pronounced gal-WAH) was born near Paris in 1811. He was brilliant, impatient, and unlucky. He twice failed the entrance exam for France’s top engineering school, the École Polytechnique. The memoirs he submitted to the Academy of Sciences fared worse. One was lost by the mathematician Augustin-Louis Cauchy. Another went home with Joseph Fourier, who died a few weeks later. A third came back with a dismissive report from Siméon Denis Poisson.10 Poisson wrote that Galois’s argument was “neither sufficiently clear nor sufficiently developed to allow us to judge its rigor.”11 (All three now have their names on mathematics that every engineering student learns.)
In 1830, at 18, Galois published a short paper titled “Sur la théorie des nombres” (“On the theory of numbers”). In it he described the new kinds of numbers that make finite fields possible, numbers that later mathematicians called “Galois imaginaries.”12 The fields that grew out of that paper would eventually bear his name.
He was also a committed republican in a monarchy. He was expelled from the École Normale for a political article, arrested twice, and spent six months in prison. On May 30, 1832, he fought a duel, for reasons that are still not entirely clear. The night before, he wrote a long letter to his friend Auguste Chevalier summarizing his mathematical discoveries, a document often called his scientific last testament. He was shot, abandoned by his seconds, and died the next day, May 31, at age 20.13
His work went almost unread for more than a decade. In 1846, the mathematician Joseph Liouville published Galois’s papers in his journal, and mathematicians slowly realized what they had nearly lost.14 Today Galois is best known for the theory that explains why there is no general formula for solving equations of the fifth degree, the way the quadratic formula solves equations of the second.
But a smaller piece of his work has had a larger effect on everyday life. The finite fields he sketched as a teenager now sit inside nearly every phone, disc drive, server, and spacecraft, quietly putting damaged data back together. Galois once scrawled in a margin that he did not have the time to finish a proof. He ran out of time for nearly everything. His mathematics didn’t.
Orwell opened 1984 with a clock striking thirteen to signal that something was off; here, the extra hour is what sets things right.
Thonky.com, “Error Correction Coding”, QR Code Tutorial. The page gives the polynomial in binary form as 100011101.
MIT Lincoln Laboratory, “Empowering Digital Communications”.
Alex Riley, “The Codes of Modern Life”, NOVA, July 15, 2015.
Riley, as in note 4. On a CD, two layers of these codes, with the data shuffled so that a scratch’s damage is spread thin, can fully repair a defect about 2.5 millimeters long, some 4,000 bits; beyond that, the player fills in what’s missing by estimating it from the surrounding sound. See Lodewijk B. Vries and Kentaro Odaka, “CIRC — The Error-Correcting Code for the Compact Disc Digital Audio System”, Audio Engineering Society, June 1982; figures from T. Aaron Gulliver, “Reed-Solomon Codes”, lecture slides, ELEC 405/511, University of Victoria, 2016.
Edward C. Posner, Lawrence L. Rauch, and Boyd D. Madsen, “Voyager Mission Telecommunication Firsts”, IEEE Communications Magazine, September 1990.
“The Code Built for a Japanese Factory”, On Further Reflection, September 22, 2026; MIT Lincoln Laboratory, as in note 3.
H. Peter Anvin, “The Mathematics of RAID-6”, 2004, updated 2011.
Università Ca’ Foscari Venezia, Security Group, “The AES cipher”.
“Évariste Galois”, Encyclopædia Britannica.
J. J. O’Connor and E. F. Robertson, “Évariste Galois”, MacTutor History of Mathematics Archive.
René Taton, “Galois, Évariste”, Complete Dictionary of Scientific Biography.
Encyclopædia Britannica, as in note 10; O’Connor and Robertson, as in note 11.
O’Connor and Robertson, as in note 11.



