Every wire, disc and radio link is noisy: bits flip in transit. The astonishing trick is that by sending a few extra bits in just the right pattern, a receiver can not only notice that something broke but figure out exactly which bit flipped and fix it — with no second copy and no re-send. Scroll down to flip bits yourself and watch the math heal them.
Take a block of 4 data bits and add one parity bit chosen so the total number of 1s is always even. The receiver re-counts the 1s: if it's odd, a bit got corrupted in transit. Click any bit below to flip it during "transmission" and watch the parity check trip. The catch: parity knows that something broke, but not where — so it can detect, but never correct.
Flip a second bit too: the two errors cancel in the count and parity is fooled into saying "OK". One parity bit only reliably catches an odd number of errors.
Hamming arranged 4 data bits (d1–d4) and 3 parity bits (p1,p2,p4) into three overlapping circles. Each parity bit makes its own circle even. When a bit flips, the set of circles that now read odd spells out a binary number — the syndrome — that is exactly the position of the broken bit. The receiver flips it back automatically. Click any of the 7 bits to introduce an error and watch it get located and repaired.
No errors yet — syndrome 000. Click a bit to flip it.
Push the noise up and transmit a few times: with one flip it always heals; with two flips Hamming(7,4) detects that something is wrong but can mis-correct — it gracefully degrades rather than silently lying. More parity bits (longer codes) buy more headroom.
The deal is always the same: spend a little redundancy to buy a lot of reliability. You don't need to re-send and you don't need a backup copy — the structure of the code itself carries enough information to undo the damage.
Error correction is quietly holding the digital world together: QR codes still scan with a coffee-cup ring blotting out part of the square (Reed–Solomon); ECC RAM in servers silently fixes bits flipped by stray cosmic rays; deep-space probes like Voyager beamed pictures across billions of kilometres on a 20-watt transmitter using heavy convolutional + Reed–Solomon coding; CDs and DVDs keep playing through scratches; and modern 5G, Wi-Fi and SSDs all lean on LDPC and similar codes.
In 1948 Claude Shannon proved the deep result behind all of this: every noisy channel has a capacity, and as long as you transmit below it, codes exist that drive the error rate as close to zero as you like. Reliable communication over an unreliable channel isn't a hack — it's a theorem.