Hamming Code Calculator
Hamming code adds parity bits at power-of-two positions: data 1011 becomes the code word 0110011.
Data bits to encode, or the received code word (even parity, parity bits at positions 1, 2, 4, 8 …).
0110011
- Parity bits r
- 3
- Parity bit values (p1, p2, p4 …)
- 0, 1, 0
- Code
- (7, 4)
Step-by-step solution
- Need 2^r ≥ m + r + 1 → r = 3
- Parity bit p covers every position whose binary index has bit p set (even parity)
- Code word: 0110011
Hamming Code Formula
2ʳ ≥ m + r + 1
parity bit p checks positions with bit p set; syndrome = error position
Worked Example
The data bits 1011:
- Need 2^r ≥ m + r + 1 → r = 3
- Parity bit p covers every position whose binary index has bit p set (even parity)
- Code word: 0110011
Parity bit values (p1, p2, p4 …): 0, 1, 0 · Code: (7, 4)
GATE tip
The syndrome read as a binary number is the position of the wrong bit; 0 means no single-bit error. Positions count from 1 at the left.
More Computer Networks and Algorithms Calculators
-
CRC Calculator
frame = data · 2ʳ + (data · 2ʳ mod G)
modulo-2 (XOR) division; r = degree of G
Example: Data 1101011111 with generator x⁴ + x + 1 (10011): Transmitted frame = 11010111110010.
-
Subnet Calculator
network = IP AND mask, broadcast = network OR wildcard
hosts = 2^(32 − prefix) − 2
Example: 192.168.10.77/26: Network address = 192.168.10.64/26.
-
Sliding Window Efficiency Calculator
η = N ÷ (1 + 2a), a = Tp ÷ Tt
GBN sequence bits ⌈log₂(N + 1)⌉, SR ⌈log₂ 2N⌉
Example: A 10 Mbps link, 1000-byte frames, 20 ms one-way delay and a window of 7 (Go-Back-N): Efficiency = 13.7254902 %.
-
Master Theorem Calculator
T(n) = aT(n/b) + Θ(nᵏ logᵖ n)
compare k with log_b a
Example: T(n) = 8T(n/2) + n²: T(n) = Θ(n^3).
Frequently asked questions
How many parity bits does Hamming code need?
The smallest r with 2ʳ ≥ m + r + 1: 3 for 4 data bits (7,4), 4 for up to 11 (15,11).
Can Hamming code correct two errors?
No. It corrects one and, with an extra overall parity bit (SECDED), detects two.
Sources
Last reviewed: . Factors are stored exactly and computed with 50-digit decimal arithmetic. See how we verify conversion factors.
Cite this page
APA
Scientific Converters. (2026, October 15). Hamming Code Calculator. Retrieved October 25, 2026, from https://scientificconverters.com/calculators/hamming-code-calculator/
IEEE
Scientific Converters, "Hamming Code Calculator," scientificconverters.com. Accessed: Oct. 25, 2026. [Online]. Available: https://scientificconverters.com/calculators/hamming-code-calculator/