Memory chips, deep-space probes, and old disk drives all face the same problem: a single bit can flip, and the system must notice and fix it without asking for the data again. Richard Hamming solved this in 1950 by adding parity bits that each watch over a different overlapping subset of positions. With four data bits and three parity bits, the seven-bit codeword can locate any single flipped bit: the pattern of failed parity checks, read as a binary number, is exactly the position of the error. This tool encodes four data bits into a Hamming (7,4) codeword and decodes codewords, correcting one error and reporting where it was. It is the clearest hands-on introduction to error-correcting codes, the same idea that scales up into the ECC memory in servers today.
Quick Answer: Enter 1011 and the tool returns the 7-bit codeword 0110011.
Free Online Tool
Hamming Code Calculator
Encode 4 data bits into a 7-bit Hamming codeword, or decode a 7-bit codeword and correct a single-bit error.
Parity bits sit at positions 1, 2, and 4; each covers a different set of positions, which is how one error is located.
How to Use the Hamming Code Calculator
- Enter your input in the tool above — for example, 1011.
- Choose any options the tool offers, such as the conversion direction or the settings that fit your case.
- Click the main button to run the tool and read the result it displays.
- Check the result against what you expected, then adjust the input and run it again if needed.
- Copy the output into your own document, code, or configuration wherever you need it.
Worked Example
Try it with 1011: the tool returns the 7-bit codeword 0110011. That example is a good first test whenever you use the tool, because it confirms you entered the input in the expected format before you trust it with your real values. This tool is built for learning error-correcting codes and checking Hamming homework, and the worked example shows the shape of a correct result so you can recognize a wrong one at a glance.
Key Features
- Runs entirely in your browser — nothing you type is uploaded anywhere.
- Built for learning error-correcting codes and checking Hamming homework, with the result shown immediately and in full.
- No account, no sign-up, and no software to install.
- Clear error messages when an input is incomplete or in the wrong format.
- Free to use as often as you like, for study, work, or checking homework.
Best Practices and Tips
- Start with the worked example in the guide, then substitute your own values.
- Double-check units and formats before trusting a result — most tool errors are input errors.
- Keep a note of the exact inputs that produced a result you rely on, so you can reproduce it.
- For anything important, cross-check with a second method or a known test value.
- Bookmark the tool if you use it regularly, so the same workflow is always one click away.
Common Mistakes to Avoid
- Placing parity bits in data positions instead of positions 1, 2, and 4.
- Expecting correction of two errors: Hamming (7,4) corrects one and only detects two.
- Copying a result without checking it against a known example first.
- Assuming the tool knows your context — it only sees the values you enter.
When This Tool Helps — and When It Doesn’t
This tool helps most when you need a fast, checkable answer for learning error-correcting codes and checking Hamming homework and you can verify the result against a known example. It does not replace professional judgment: for decisions with real consequences, treat the output as one input among several, verify it independently, and remember that the tool can only work with exactly what you enter. Used that way — quick check, verified result, human decision — it saves time without creating false confidence.
Frequently Asked Questions
How does the decoder know where the error is?
Each parity bit covers a different subset of positions. The three pass/fail results form a three-bit number, and that number is the position of the flipped bit. No search is needed.
What happens with two flipped bits?
The syndrome points to a wrong position and “correcting” it makes things worse. Hamming (7,4) guarantees single-error correction; two errors need a stronger code or an extra overall parity bit for detection.
Where is Hamming code actually used?
In ECC memory, in some storage and communication systems, and historically in deep-space links. Modern systems often use stronger codes, but the parity-position idea is the same.
Related Tools
- Quoted-Printable Encoder / Decoder – Encode text to MIME quoted-printable form, or decode it back to plain text
- UTF-8 Byte Counter – Count the UTF-8 bytes your text really occupies, distinct from its character count
- Base58 Encoder / Decoder – Encode text to Base58 or decode Base58 back to text, using the Bitcoin alphabet
