Calculator: Hamming (7,4) encoding

Enter four data bits. Optionally choose one error-bit position and inspect its correction.

Encoded 7-bit word
0110011
Received 7 bits
0110011
Syndrome (0 = no error)
0
Recovered 4 data bits
1011

How the calculation works

p₁=d₁⊕d₂⊕d₄; p₂=d₁⊕d₃⊕d₄; p₄=d₂⊕d₃⊕d₄

Uses even parity. Position 0 leaves the codeword unchanged; positions 1–7 flip one bit. Correction is demonstrated for a single-bit error.

Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

Frequently asked questions

How is the result calculated?

p₁=d₁⊕d₂⊕d₄; p₂=d₁⊕d₃⊕d₄; p₄=d₂⊕d₃⊕d₄

What assumptions apply?

Uses even parity. Position 0 leaves the codeword unchanged; positions 1–7 flip one bit. Correction is demonstrated for a single-bit error.

How precise are the displayed results?

Numerical results show up to ten significant digits. Rounding does not improve the accuracy of the input measurements or the model. Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

How we verified this calculator

The calculator is checked against 3 reference cases computed independently of its code. Last passed: .

# Inputs Expected result
1
Four data bits = 1011
Error-bit position (0 = none; 1–7) = 0
Encoded 7-bit word: 0110011
Received 7 bits: 0110011
Syndrome (0 = no error): 0
Recovered 4 data bits: 1011
2
Four data bits = 1011
Error-bit position (0 = none; 1–7) = 5
Encoded 7-bit word: 0110011
Received 7 bits: 0110111
Syndrome (0 = no error): 5
Recovered 4 data bits: 1011
3
Four data bits = 0110
Error-bit position (0 = none; 1–7) = 7
Encoded 7-bit word: 1100110
Received 7 bits: 1100111
Syndrome (0 = no error): 7
Recovered 4 data bits: 0110

How we test our calculators →

Also try:

Back to category →