tools

CRC Calculator

CRC-8/16/32 with common presets (Modbus, CCITT, Ethernet, STM32 hardware CRC) or custom parameters, plus C code.

[loading tool…]

How it works

A CRC is the remainder of dividing the message, seen as a long binary polynomial, by a generator polynomial. Every CRC variant is fully described by six parameters (the Rocksoft model used by the CRC RevEng catalogue):

Parameter Meaning
width number of bits in the result
poly generator polynomial, without its top bit
init register value before the first byte
refin process each input byte LSB-first
refout reverse the register before the final XOR
xorout value XORed into the result

Each preset shows its check value: the CRC of the ASCII string 123456789. If your firmware gives the same check value, your parameters match.

STM32 hardware CRC

With its reset configuration, the STM32 CRC unit uses polynomial 0x04C11DB7, init 0xFFFFFFFF, no reflection and no final XOR: that is CRC-32/MPEG-2, not the zlib CRC-32. Feeding it 32-bit words instead of bytes changes the result on little-endian parts. Set the input size to 8 bits, or enable input/output reversal and XOR with 0xFFFFFFFF in software, to get the Ethernet/zlib value.

C implementation

The generated C uses a 256-entry table and processes one byte per step. The same table logic is unit-tested against every preset’s check value.

References

esc
All tools
ADC / DAC Resolution Calculator[embedded]
Base64 Encoder / Decoder[dev]
Battery Runtime Calculator[hardware]
Chmod Calculator[dev]
CRC Calculator[embedded]
Cron Expression Builder[dev]
CSV ⇄ JSON Converter[dev]
Duty-Cycle Battery Life[embedded]
Generator Wattage Calculator[hardware]
Hash Generator[dev]
HTML Entity Encoder[dev]
JSON Formatter & Validator[dev]
JSONPath Tester[dev]
JWT Decoder[dev]
LED Resistor Calculator[embedded]
LLM Memory / VRAM Estimator[ai]
Lorem Ipsum Generator[text]
Markdown Preview[text]
Markdown Table Generator[text]
Number & Float Inspector[embedded]
Number to Words[text]
Ohm's Law Calculator[embedded]
Password Generator[dev]
Quantization Size Calculator[ai]
RC / LC Filter Calculator[embedded]
Regex Tester[dev]
Register / Bitfield Viewer[embedded]
Resistor Color Code[embedded]
Roman Numeral Converter[text]
Solar Battery Bank Sizing[hardware]
Solar Panel Output[hardware]
SQL Formatter[dev]
Subnet / CIDR Calculator[dev]
Tensor Shape Calculator[ai]
Timer / PWM Calculator[embedded]
UART Baud Rate Error[embedded]
Unix Timestamp Converter[dev]
UPS Runtime Calculator[hardware]
URL Encoder & Parser[dev]
UUID Generator & Inspector[dev]
Voltage Divider Calculator[embedded]
Voltage Drop Calculator[hardware]
Wire Size Calculator[hardware]
XML Formatter[dev]
YAML Validator & Converter[dev]
Commands
Toggle theme (auto → light → dark)
Copy link to this page
Go to all tools
Lire en français
↑↓ move↵ open⌘↵ new tab