← All tools

Hamming Code (7,4) & SECDED

Encode 4 data bits into a 7-bit Hamming(7,4) codeword with three parity bits, and decode a received word — detecting and correcting any single-bit error via the syndrome. Toggle on an extra overall parity bit for SECDED (Hamming(8,4)), which also detects (but cannot correct) double-bit errors. The parity-bit coverage, the syndrome calculation, and the corrected codeword are shown step by step. Everything runs locally in your browser.

Data bits (4)

Parity-bit coverage

p = parity bit (positions 1, 2, 4…)   d = data bit (positions 3, 5, 6, 7). Even parity: each parity bit makes the XOR of its covered positions zero.

Hamming(7,4) maps 4 data bits to a 7-bit codeword using 3 parity bits placed at power-of-two positions (1, 2, 4). Each parity bit covers the positions whose binary index includes its bit: p1 → 1,3,5,7; p2 → 2,3,6,7; p4 → 4,5,6,7. On decode, the three parity checks form a 3-bit syndrome whose value (1–7) is exactly the position of a single flipped bit (0 = no error), so the error is corrected by flipping that bit. SECDED (single-error correction, double-error detection) prepends an overall parity bit: an odd overall parity with a nonzero syndrome means one correctable error; an odd overall parity with a zero syndrome means the parity bit itself is wrong; an even overall parity with a nonzero syndrome means a double-bit error that cannot be corrected. Pairs with the CRC32 & Adler-32 tool. Everything runs locally — nothing leaves your browser.