TestBench.tools

CRC-32 Calculator

Standard CRC-32 (ISO-HDLC) checksum for hex bytes or text.

9 bytes

CRC-32
0xCBF43926
Bytes (little-endian)
26 39 F4 CB
Bytes (big-endian)
CB F4 39 26
Decimal
3421780262

This tool computes the standard 32-bit CRC (the ISO-HDLC model) over hex bytes or ASCII text, entirely in your browser. The reference check value: ASCII 1234567890xCBF43926. Both little- and big-endian byte views are shown so you can match whatever layout your protocol or file format expects.

How it works

CRC-32 divides the message, treated as one long binary polynomial, by the generator polynomial 0x04C11DB7 and keeps the 32-bit remainder. The model reflects input and output bits, starts from an all-ones register (0xFFFFFFFF) and inverts the final remainder (XOR 0xFFFFFFFF). Reflection lets software keep the register in bit-reversed order and shift right using the reversed polynomial 0xEDB88320 — one XOR and shift per bit, eight per byte.

The same model family includes CRC-32/BZIP2, which keeps the same polynomial, init and final XOR but does not reflect — its check value over 123456789 is 0xFC891918. If your device reports that value, it is the unreflected variant; you can reproduce it with the Custom CRC tool.

Worked example

input (ASCII): 123456789
bytes       : 31 32 33 34 35 36 37 38 39
CRC-32     : 0xCBF43926
LE bytes   : 26 39 F4 CB  ·  BE bytes: CB F4 39 26

Parameters

ParameterValueNotes
Width32
Polynomial0x04C11DB70xEDB88320 in reflected form
Init0xFFFFFFFF
RefIn / RefOuttrue / true
XorOut0xFFFFFFFF
Check (“123456789”)0xCBF43926

Python implementation

Python
# CRC-32 (ISO-HDLC): poly 0x04C11DB7 reflected -> 0xEDB88320,
# init 0xFFFFFFFF, xorout 0xFFFFFFFF, refin/refout.
def crc32(data: bytes) -> int:
    crc = 0xFFFFFFFF
    for byte in data:
        crc ^= byte
        for _ in range(8):
            crc = (crc >> 1) ^ 0xEDB88320 if crc & 1 else crc >> 1
    return crc ^ 0xFFFFFFFF

assert hex(crc32(b"123456789")) == "0xcbf43926"
# stdlib equivalents: zlib.crc32 / binascii.crc32

FAQ

Which CRC-32 does this calculate?

The ubiquitous ISO-HDLC variant: polynomial 0x04C11DB7, init 0xFFFFFFFF, reflected input and output, final XOR 0xFFFFFFFF. Its check value over the ASCII string 123456789 is 0xCBF43926.

Why do reflected implementations use 0xEDB88320?

0xEDB88320 is the bit-reversed form of the polynomial 0x04C11DB7. Because CRC-32 reflects both input and output, an implementation can keep the register in reflected order the whole time and shift right, which is what the snippet below does.

My firmware gives a different value for the same bytes — why?

Check the model parameters: some systems use the same polynomial with different init/xorout or without reflection (e.g. the BZIP2 variant, check value 0xFC891918). The Custom CRC tool on this site lets you match any parameter combination.

How do I verify this tool?

Type 123456789 in ASCII mode: the result must be 0xCBF43926. That check value is pinned in this site's automated test suite.

Is anything uploaded?

No — the CRC is computed locally in your browser. Your data never leaves your machine.

Related tools