Hamming Code and CRC Calculator

Calculate the checksum your protocol expects, or see exactly how Hamming codes find and fix a flipped bit.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Choose CRC or Hamming

    The tool you need.

  2. 2
    Enter data

    Text or hex for CRC, bits for Hamming.

  3. 3
    Read the CRC table

    14 algorithms at once.

  4. 4
    Check parameters

    Polynomial, init, reflection.

  5. 5
    Encode a Hamming word

    With or without SECDED.

  6. 6
    Decode a received word

    Find and fix the error.

About this tool

Data gets corrupted: electrical noise flips bits on a serial line, a storage sector degrades, a radio packet loses a burst of bits. Error-detecting and error-correcting codes catch these problems. Cyclic redundancy checks, CRCs, are everywhere: Ethernet frames, ZIP and PNG files, Modbus and CAN messages, SD cards and countless embedded protocols. Each uses a specific polynomial, initial value, bit order and final XOR, and getting one parameter wrong gives a checksum that never matches. This calculator computes fourteen standard CRCs at once for any text or hex input, from CRC-8 and the Dallas 1-Wire CRC through CRC-16 variants such as MODBUS, CCITT-FALSE, KERMIT, XMODEM and X-25, to CRC-32, CRC-32C, BZIP2, MPEG-2 and two CRC-64 variants, and shows the parameters of each. Every algorithm is verified against the published check value for the standard test string 123456789. The Hamming tool encodes data bits into a Hamming codeword, optionally extended with an overall parity bit for SECDED, and decodes received words, locating and correcting single-bit errors and detecting double-bit errors.

How CRCs work

A CRC treats the message as a large binary polynomial and divides it by a fixed generator polynomial; the remainder is the checksum. An n-bit CRC detects every error burst up to n bits long and all single and double bit errors for messages up to a certain length, and misses a random corruption with a probability of about 1 in 2 to the power n.

Why so many variants

Two CRC-16s with the same polynomial can still differ in initial value, whether bytes are reflected, and final XOR. MODBUS and ARC share the polynomial 0x8005 but start from different values. When matching a device, compare its check value for 123456789 with the table.

Hamming codes

Hamming codes place parity bits at positions 1, 2, 4, 8 and so on. Each parity bit covers the positions whose binary index includes it. When a word is received, recomputing the parities gives the syndrome, which is the position of a single flipped bit. Adding one overall parity bit (SECDED) also detects, but cannot correct, two flipped bits. ECC memory in servers uses this principle.

Detection is not security

CRCs and Hamming codes protect against accidental errors. Anyone can recompute a CRC after changing data, so use a cryptographic hash or MAC to detect deliberate tampering.

Limits

CRC input is limited by browser memory but handles files of several megabytes quickly as hex or text. Hamming codes here handle up to a few hundred data bits for learning and checking; production systems use hardware or optimised libraries.

Worked example

The text 123456789 gives CRC-32 0xCBF43926, CRC-16/MODBUS 0x4B37 and CRC-8 0xF4, matching the published check values, and Hamming encoding of data 1011 gives the codeword 0110011, from which a received 0110001 is corrected at position 6.

Quick facts

Frequently asked questions

Which CRC does Modbus use?

CRC-16/MODBUS: polynomial 0x8005 reflected, initial value 0xFFFF.

Which CRC do ZIP and PNG use?

CRC-32, the same as Ethernet.

Why does my CRC not match?

Usually a different initial value, bit reflection or final XOR; compare check values.

How many errors can Hamming codes fix?

One bit per codeword; SECDED also detects two.

Is a CRC secure?

No. It detects accidents, not deliberate changes.

Is my data uploaded?

No. Everything runs in your browser.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages