Report

Help us improve this tool

Hamming Code Calculator

Encode, decode, and correct single-bit errors in binary messages using Hamming (7,4) error correction codes.

O M T

What Is a Hamming Code?

Hamming codes are error-correcting codes that detect and fix single-bit errors in binary messages. The Hamming (7,4) code encodes 4 data bits into 7 bits using 3 parity bits placed at power-of-two positions.

How Hamming (7,4) Works

Data bits occupy positions 3, 5, 6, and 7. Parity bits at positions 1, 2, and 4 each cover a unique subset of positions. During decoding, the syndrome (parity check result) pinpoints any single flipped bit.

Pair this with the Hamming Distance Calculator and Even Parity Calculator for a complete error-detection toolkit.

Frequently Asked Questions

What does Hamming (7,4) mean?

It means 7 total bits with 4 data bits and 3 parity bits. The code can correct any single-bit error within each 7-bit block.

How do I encode a binary message?

Split your data into 4-bit blocks, pad the last block if needed, and encode each block separately. The tool outputs the full encoded bitstream.

Can Hamming codes fix multiple errors?

No. Hamming (7,4) reliably corrects only one flipped bit per block. Two or more errors in the same block may go undetected or be corrected incorrectly.

What is a syndrome in Hamming codes?

The syndrome is the result of parity checks on received bits. A non-zero syndrome value equals the position of the flipped bit.

Why use Hamming codes?

They add minimal overhead while allowing receivers to detect and automatically correct single-bit transmission errors without retransmitting the entire message.