Hamming Code Calculator

Find the parity bits needed for a Hamming code.

Parity bits (r) 3
Total code length 7

Formula: Smallest r with 2^r >= m + r + 1

Step-by-step with your numbers:
1. Values used:
2. Data bits (m) = 4
3.
4. Parity bits (r) = 3
5. Total code length = 7
Did we solve your problem today?

Hamming codes add parity bits so single-bit errors can be detected and fixed.

The math behind it

You need the smallest r where 2^r >= m + r + 1, giving m + r total bits.

Worked example

4 data bits need 3 parity bits (a 7-bit code, the classic Hamming(7,4)).

FAQ

What can it correct?

Any single-bit error, and it can detect (not fix) some double-bit errors.