Hamming Code Calculator

Your details

Encode mode converts raw data bits into a Hamming codeword. Detect & Correct mode takes a full received codeword and finds or fixes any single-bit error.
The Hamming(n,k) notation: n is the total codeword length and k is the number of data bits. The number of parity bits r = n - k.
Enter the binary data to encode. Only 0s and 1s are allowed (spaces ignored). The number of bits must match the k value of the chosen code size.
Hamming codeword
0110011

Encoded binary message with parity bits inserted at power-of-2 positions.

Parity bits added3
Codeword length7bits
Code rate (k/n)0.5714
Parity bits3
Total codeword length7

4-bit data encoded into a 7-bit Hamming codeword with 3 parity bits.

  • Parity bits occupy positions 1, 2, 4 (powers of 2).
  • Code rate is 57.1%, meaning 57.1% of each codeword carries actual data.
  • This is a SEC (Single Error Correcting) code: any single flipped bit in transmission can be found and fixed by the receiver.
  • To introduce a test error, flip one bit in the codeword and paste it into Detect & Correct mode.

Next stepCopy the codeword above, optionally flip one bit to simulate a transmission error, and switch to Detect & Correct mode to see the syndrome calculation.

= Powered by OnlyCalculators