Hamming Code Parity Bits
Find how many parity bits a SEC Hamming code needs for a given number of data bits, plus the overhead.
Your recent runs (stored only in your browser)
No calculations yet — results land here so you can compare runs.
The engineering
A single-error-correcting (SEC) Hamming code protects m data bits by adding k parity bits, each covering a distinct set of bit positions so the failing bit's index reads out directly from the parity syndrome. The card solves the packing bound: the k parity bits must produce enough distinct syndromes (2^k) to name every bit position plus the no-error case, hence 2^k ≥ m + k + 1.
The classic (7,4) code drops out at m = 4, k = 3. Overhead shrinks fast as blocks grow — a 64-bit word needs only 7 parity bits — but adding one extra overall-parity bit (SECDED) buys double-error detection, which is why real DRAM ECC uses (72,64), not bare Hamming. Sanity check: k should never exceed about log₂(n)+1.
Where this math comes from
Richard Hamming was a mathematician at Bell Labs frustrated by weekend batch jobs on the relay computers: a single detected error would halt the run and he'd lose the whole weekend to a machine that knew it was wrong but couldn't fix itself. "If the machine can detect an error," he reasoned, "why can't it locate and correct it?" He worked out the position-based parity scheme in 1947–1949.
Bell held the paper up over patent filing, so it wasn't published until 1950. The idea of interlocking parity checks whose combined syndrome points straight at the bad bit founded the whole field of error-correcting codes, and Hamming distance became the standard way to measure how far apart two codewords sit.
- 1947Richard HammingDevises position-parity error correction on Bell Labs relay machines.
- 1950Richard HammingPublishes 'Error Detecting and Error Correcting Codes' in the Bell System Technical Journal.
- 1961IBM / industrySECDED variants adopted for computer memory reliability.
- 1968ACMAwards Hamming the Turing Award, citing this work among others.
See the full timeline of the math behind every calculator →
Runs entirely in your browser — nothing you enter leaves this page. Your recent runs are stored only on your device.