Skip to content

Hamming code calculator

Encode data or check one Hamming codeword with clearly numbered even-parity positions.

Hamming inputs

Processed in your browser.

Encode: 4 or 11 data bits. Check: 7 or 15 codeword bits. The gray value is a worked example. Calculate uses it; focusing any field clears it for your own data.

Code result

Choose a mode and action, enter bits, then calculate.

How to use it

Choose Hamming(7,4) for four data bits or Hamming(15,11) for eleven. Encode inserts parity bits; Check evaluates a received 7- or 15-bit codeword and shows the corrected word under the single-error assumption.

Position and parity convention

The displayed string is numbered left to right starting at position 1. Powers of two are parity positions. Each even-parity check covers positions whose binary position number contains that parity bit.

Worked example

For data 1011 in (7,4) mode, the result is 0110011 with this page’s left-to-right convention. Flipping position 5 gives syndrome 5, so a single-bit correction restores the original codeword and data.

Limits and FAQ

Leading zeroes are preserved. A zero syndrome means all checks passed, not that arbitrary corruption is impossible. Two or more changed bits can produce a misleading syndrome; SECDED and simulation are outside this tool.

How to read the syndrome

Each failed parity check contributes its parity position number. Adding those positions gives the syndrome. Syndrome 0 means no single-bit error was found; a nonzero value identifies the bit to flip only under the one-error assumption.

When Hamming code is useful

Hamming code is useful for learning parity placement and for systems designed around single-error correction. It is not encryption, compression, a checksum for arbitrary files, or protection against bursts of corruption. Real systems may add an overall parity bit (SECDED) or stronger error-correcting codes.