How to use the crc calculator with many algorithms
- Choose whether your input is text (read as UTF-8 bytes) or hex bytes, and enter the data.
- Choose the algorithm. The name fixes the width, polynomial, starting value, bit order and final XOR.
- Read the CRC in hex, decimal and in both byte orders, and check the check value line, which tests the algorithm on the text 123456789.
- Use the table to see the same data under every algorithm, which helps when a name is confusing.
Formula
register = initial value
for each byte: reverse its bits if the input is reflected, XOR it into the top of the register, shift left 8 times and XOR the polynomial after each 1 bit falls off the top
result = (reverse register if the output is reflected) XOR final value
This is the standard CRC model. Equivalently, the data is treated as a long binary number and divided by the polynomial, and the remainder is the CRC.
CRC-16/MODBUS on a request and the check text
The text 123456789 is the standard test input. Under CRC-16/MODBUS it gives 0x4B37, under CRC-16/XMODEM 0x31C3, under CRC-16/IBM-3740 0x29B1, and under CRC-32/ISO-HDLC 0xCBF43926. If your tool disagrees on this text, it is using different settings.
A Modbus request of the bytes 01 03 00 00 00 0A gives 0xCDC5. Modbus sends the low byte first, so the frame ends with C5 CD, which the page shows as the least significant byte order. Under CRC-8/SMBUS the same nine test characters give 0xF4, and under CRC-32/ISCSI (CRC-32C) 0xE3069283.
Why one name can mean different results
A CRC is defined by five settings besides the width: the polynomial, the starting value, whether input and output bits are reflected and the final XOR. Two algorithms with the same polynomial but different settings give different results. CRC-16/XMODEM and CRC-16/IBM-3740 share a polynomial, but one starts at 0x0000 and the other at 0xFFFF.
Older names are also inconsistent. "CRC-16" alone usually means CRC-16/ARC, "CCITT" has been used for both IBM-3740 and KERMIT, and X-25 is another name for IBM-SDLC. The page lists the catalog names with alternative names in the notes so you can match the one in your specification.
Where CRCs fit
CRCs catch accidental changes in data that travels or is stored: serial protocols, file formats, firmware images and network frames. They are fast and small, but they are not secure against deliberate changes. For that, use a hash such as those in the Hash Generator or a keyed hash from the HMAC Generator. For the common 32 bit checksums, the CRC32 Checksum Calculator is the quicker choice, and the Check Digit Validator covers check digits in numbers.
Assumptions and limits
- Text is converted to UTF-8 bytes. Line breaks are normalized to a single line feed before computing.
- Up to 200,000 bytes of data are accepted. Hex input ignores spaces, commas, colons, dashes and a 0x prefix.
- The catalog covers CRC widths of 8, 16 and 32 bits with the names and settings of the public CRC catalog.
- A CRC detects accidental errors only and is not a security measure.
Frequently asked questions
What is the check value?
It is the CRC of the ASCII text 123456789 under that algorithm. Reference lists publish it so you can confirm that an implementation uses the right settings. The page shows whether its own result matches.
Why do two tools give different CRC-16 results?
CRC-16 is a family, and tools may default to different members such as ARC, MODBUS or XMODEM. Pick the exact name from your device or protocol and compare check values.
In what order are CRC bytes sent?
It depends on the protocol. Modbus sends the low byte first. Many others send the high byte first. The page shows both orders so you can match the protocol.
Does CRC-32 here match the one in zip files?
Yes. CRC-32/ISO-HDLC is the CRC-32 used by zip, PNG, gzip and Ethernet. CRC-32/ISCSI is the Castagnoli variant, also called CRC-32C, which is a different polynomial.