Every time a satellite packet lands, a RAM chip powers up, or a QR code is scanned, something is quietly
correcting errors — flipping the wrong bits back to what was meant. Hamming codes are the
classic way to do it: a few extra parity bits turn a short burst of static into a message a machine
can repair on its own. Click bits to corrupt them, and watch the syndrome decode exactly where the damage is.
Live
The Shielded Block
Blue bits are your message. Gold bits are the
parity the code adds. Click any bit to flip it (that simulates a transmission error), then flip it back or
hit Fix to see the syndrome pinpoint the mistake. With the shield on, a single flip is always repaired perfectly.
data bit parity bit flipped / in error corrected
Decoder
What the receiver sees
Each parity bit covers a group of positions — the groups are the binary count 001, 010, 100 (which positions have that bit set). The syndrome is the XOR of the checks that fail. Read its binary value as a position number and that bit is the culprit.
Under the hood
How the shield works
01 · POSITIONING
Parity lives at powers of two
Bit positions 1, 2, 4, 8… (binary 1000, 0100, 0010) are reserved for parity. Everything else is data.
02 · COVERAGE
Each check guards a group
Check i (for bit 2ⁱ) covers every position whose binary form has bit i set. Overlapping groups are what make single errors findable.
03 · SYNDROME
Failing checks form a number
For each failing parity check, set a bit in the syndrome. The resulting binary number is the position of the corrupted bit.
04 · REPAIR
Flip it and you're done
Flip the flagged bit and every check becomes consistent again. With m parity bits, all single-bit errors are corrected.
Game
Recovery Shift
A corrupted block has just arrived and the link is timing out. Find the one bad bit and fix it before the
bar empties. Consecutive clean recoveries build your streak. This is the skill every memory controller,
modem, and hard drive does millions of times a second.
Score0
Streak0
Best0
Link integrity0.0s
About Hamming Shield
Why this project?
Error correction is one of the most important ideas in computing — it's why your phone recovers a signal
through a tunnel and why a scratched disc still plays — yet almost nobody has ever seen it work.
Most treatments jump straight to equations. This project turns Richard Hamming's 1950 breakthrough into
something you can poke: break a code by hand, then watch the parity checks point a finger at the exact
broken bit.
What is it?
An interactive explorer for Hamming error-correcting codes, in two code sizes — (7,4) and (15,11). The
main board shows your data plus the parity bits the code adds. Flip bits to simulate transmission errors
and the decoder walks through the syndrome to locate and repair a single-bit error. A timed "Recovery
Shift" mini-game lets you practise the skill under pressure.
How does it work?
Positions. Bits are numbered from 1. Positions that are powers of two (1, 2, 4, 8) hold parity bits; the rest hold data.
Coverage. The parity bit at position 2ⁱ covers every position whose binary representation has bit i set. For example, bit 1 (binary 001) covers positions 1, 3, 5, 7…
Encode. Each parity bit is set so that the number of 1s in its covered group is even (even parity).
Decode. On receipt, recompute each check. The set of failing checks forms a binary number — the syndrome. Its value is exactly the position of the corrupted bit.
Fix. Flip that bit. If the syndrome is 0, nothing was wrong.
With m parity bits you protect 2ᵐ − 1 total positions, so a (7,4) code uses
3 check bits to guard 7 and (15,11) uses 4 to guard 15.
One caveat: these codes correct single-bit errors. Two simultaneous flips can masquerade as one —
which is why real systems often add an overall parity bit to detect the double-error case.
How to use it
Pick a code size and enter a message (or hit 🎲). It's automatically padded and encoded.
Click any bit in the grid to flip it — that simulates an error. The board marks it red.
Toggle Auto-decode to see every check recompute live, or leave it off and press Decode & Fix to walk through the syndrome and repair the block.
Use Corrupt bit to inject a random error, and Reset to restore the original code word.
In Recovery Shift, press Start shift and click the one bad bit before the link-integrity bar runs out to build a streak.