Scientific Converters Precise unit conversions for science & engineering.

    Loading…

    Hamming Code Calculator

    Hamming code adds parity bits at power-of-two positions: data 1011 becomes the code word 0110011.

    Calculate:

    Data bits to encode, or the received code word (even parity, parity bits at positions 1, 2, 4, 8 …).

    Hamming code word

    0110011

    Parity bits r
    3
    Parity bit values (p1, p2, p4 …)
    0, 1, 0
    Code
    (7, 4)
    Step-by-step solution
    1. Need 2^r ≥ m + r + 1 → r = 3
    2. Parity bit p covers every position whose binary index has bit p set (even parity)
    3. 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:

    1. Need 2^r ≥ m + r + 1 → r = 3
    2. Parity bit p covers every position whose binary index has bit p set (even parity)
    3. 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

    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/

    Send feedback

    Found a wrong value, a missing unit or an idea? Tell us. We read every message.

    What is it about?

    We store your message, the page you were on and your email if given. See the privacy policy.