- Home
- Engineering
- Computer
- Computer Networks
- Hamming Code Calculator (Encode & Correct)
Hamming Code Calculator (Encode & Correct)
Hamming codeword for a data word with even parity, or find and correct a single-bit error.
Practice questions
Textbook-style questions. Press Solve in the tool to load the values and see the full solution. Underlined words are explained below.
Find the Hamming code for the data word 1011 using even parity.
The codeword 0110111 is received. Find and correct the error.
Encode the 8-bit data word 10011010 with Hamming code.
Worked example
Here's the first practice question solved in full, so you can see exactly what you'll get. Try it on paper before you read the steps.
Question: Find the Hamming code for the data word 1011 using even parity.
- Write the given values
- Number of parity bits
- Work out each parity bit (even parity)
- Codeword
- Write the given values
Encode a data word = 1011 - Number of parity bitsm = 4 data bits. The smallest r with 2r ≥ m + r + 1 is r = 3, so the codeword has 7 bits.
- Work out each parity bit (even parity)
P1 = checks 3, 5, 7: 2 ones → P1 = 0 P2 = checks 3, 6, 7: 3 ones → P2 = 1 P4 = checks 5, 6, 7: 2 ones → P4 = 0 - Codeword
P1 P2 D3 P4 D5 D6 D7 0 1 1 0 0 1 1
Terms used on this page
New to a word in the question or the solution? Here it is in simple language.
- Bit
- A single binary digit, 0 or 1. 8 bits make one byte.
Symbols in this solver
What each box asks for, and its unit.
| Symbol | What it means | SI unit |
|---|---|---|
| Bits (data word or received codeword) | text |
Formula & concept
Build the Hamming code for a data word with even parity, or check a received codeword, find the wrong bit and correct it.
Key idea: Each parity bit checks the positions whose binary number has that bit set. When a bit flips, the failed checks add up to exactly its position.
How to use this calculator
- Type the known values from your question and pick the unit for each one.
- Press Solve step by step.
- Read the plan first. It lists the steps the solution will follow. Want to try it yourself? Tick Practice mode and the answer stays hidden until you ask for it.
- Check the answer, then go through each numbered step. Where there's a second method, it's shown after the main one.
- Stuck on a word? The terms section explains it in simple language.