Hamming Code Calculator
Data ⇄ codeword + single-error detection and correction — the syndrome locates the faulty bit.
What it does: Encode Hamming code, or detect and correct a single-bit error in a received codeword.
When to use it: When learning error-correcting codes or working on communication/storage reliability.
MEANS Parity bits sit at positions 1/2/4/8…; when decoding, a non-zero syndrome points to the faulty bit.
No history yet. Each calculation is automatically saved to this device.
How to use the Hamming code calculator
Pick a mode and enter a 0/1 string.
- 01
Pick a mode
Encode (data → codeword) or Decode / correct (codeword → detect and fix errors).
- 02
Enter a 0/1 string
For encoding, type the data bits (e.g.
1011); for decoding, type the received codeword. - 03
Read the result
Encoding gives the full codeword; decoding gives the syndrome, error position and the corrected codeword.
Common questions, answered in 3 minutes
How many errors can Hamming code correct?
A basic SEC Hamming code corrects 1 bit error. The value of the syndrome is exactly the position of the faulty bit; 0 means no error.
Where do the parity bits go?
At positions 1, 2, 4, 8… (powers of two); data fills the remaining positions. In this tool, positions are counted from 1 starting at the left.
What happens with a 2-bit error?
A basic Hamming code cannot tell them apart and will mis-correct another bit. Detecting 2-bit errors needs SECDED (one extra overall parity bit).
How is the syndrome computed?
Each parity bit checks even parity over the bits it covers; summing the position values of the failing parity bits gives the error position.
Standards and sources referenced by this tool
| Item | Value / Formula | Source |
|---|---|---|
| Hamming SEC | Parity bits at 2^k positions | Hamming (1950) |
Classic Hamming SEC algorithm, no external API.