CRC and checksums (Modbus CRC16, CRC32)
Paste the bytes of a frame to get its checksums and the frame with the CRC appended, ready to send over a serial port.
Result
- CRC bytes in the frame (low byte first)
- C5 CD
- Data bytes
- 6
01 03 00 00 00 0A C5 CD
:01030000000AF2\r\n
| Algorithm | hex | decimal |
|---|---|---|
| CRC-16/MODBUS | 0xCDC5 | 52677 |
| CRC-16/IBM-3740 (CCITT-FALSE) | 0x0428 | 1064 |
| CRC-16/XMODEM | 0x0A38 | 2616 |
| CRC-16/KERMIT | 0xB6BD | 46781 |
| CRC-16/ARC | 0xD6C5 | 54981 |
| CRC-32 (ISO-HDLC) | 0xDDEBE1C8 | 3723223496 |
| CRC-32C (Castagnoli) | 0x9BCB8F5F | 2613808991 |
| CRC-8/SMBUS | 0xB9 | 185 |
| LRC (Modbus ASCII) | 0xF2 | 242 |
| XOR (BCC) | 0x08 | 8 |
| Sum mod 256 | 0x0E | 14 |
| Sum mod 65536 | 0x000E | 14 |
Modbus RTU sends the CRC at the end of the frame, low byte first. Algorithm parameters follow the CRC RevEng catalogue.
CRC in Modbus RTU
Modbus RTU uses CRC-16/MODBUS: polynomial 0x8005 in reflected form (0xA001), initial value 0xFFFF. The two CRC bytes go at the end of the frame, low byte first. Example: reading 10 registers from address 0 of device 1 is 01 03 00 00 00 0A; its CRC is 0xCDC5, so the frame ends with C5 CD.
LRC in Modbus ASCII
Modbus ASCII uses an LRC instead: the sum of the address, function and data bytes modulo 256, negated (two’s complement). The frame starts with a colon, carries the bytes as hex characters and ends with CR LF.
Which CRC?
If a device manual only says “CRC16”, compare against a known frame: different CRC-16 variants give different results for the same data. The standard check for any algorithm is its result for the text “123456789”, e.g. 0x4B37 for CRC-16/MODBUS and 0xCBF43926 for CRC-32.
Need more?
Kalkio covers what is needed most often. For more advanced work we recommend:
- CRC RevEng – Catalogue of CRC algorithms – parameters of over a hundred CRC variants with check values
- CyberChef – hundreds of data operations chained together: encodings, checksums, compression (runs in your browser)
Common questions
Why is my CRC byte order reversed?
Modbus RTU sends the CRC low byte first. The value 0xCDC5 goes into the frame as C5 CD. The calculator shows both.
Should the device address be part of the data?
Yes. The CRC covers the whole frame: device address, function code and data, without the CRC bytes themselves.