CRC calculator

Compute CRC-8, CRC-16, CRC-32 and CRC-64 of text, hex bytes or a file with 40+ standard variants (Modbus, CCITT, CRC-32C, XZ…) or your own polynomial.

loading CRC calculator
About this tool

What is a CRC and what does this calculator do?

A cyclic redundancy check (CRC) is a short checksum computed from a block of bytes. Senders append it to a message, receivers recompute it, and a mismatch means the data was damaged on the way. CRCs are everywhere: Ethernet frames, ZIP and PNG files, Modbus and CAN buses, USB packets, flash memory images, RFID tags and storage formats. They are built to catch accidental errors such as flipped bits and burst noise. They are not a security feature: anyone can forge data with a chosen CRC, so use a hash or an HMAC when tampering matters.

The trouble is that "CRC-16" is not one algorithm. A CRC is defined by six parameters: the width in bits, the polynomial, the initial register value, whether input bytes are reflected, whether the result is reflected, and a final XOR. Change any one and you get a different number for the same bytes. This tool follows that standard parameter model (often called the Rocksoft model) and includes a catalogue of 43 well-known variants of 8, 16, 32 and 64 bits, such as CRC-16/MODBUS, CRC-16/IBM-3740 (also known as CCITT-FALSE), CRC-16/XMODEM, CRC-32/ISO-HDLC (the "CRC-32" of ZIP, PNG and Ethernet), CRC-32/ISCSI (CRC-32C) and CRC-64/XZ. Each preset was checked against the published check value for the ASCII text 123456789.

If your protocol uses something that is not in the list, switch to custom parameters and enter any width from 3 to 64 bits with your own polynomial, initial value, final XOR and the two reflection switches. Everything runs in your browser. Text, hex bytes and files are never uploaded.

How to calculate a CRC

  1. Choose the algorithm. The page opens with CRC-32/ISO-HDLC selected and the sentence "The quick brown fox jumps over the lazy dog" loaded as input. The list is searchable and shows a common alias next to the name, for example "CRC-32/ISCSI (CRC-32C)".
  2. Choose how to read the input. "Text (UTF-8)" turns what you type into UTF-8 bytes. "Hex bytes" reads values such as 48 65 6c 6c 6f, 0x48,0x65 or 48656c6c6f, which is the usual way to test a frame captured from a device. You can also open a file and the tool uses its bytes instead of the text box.
  3. Read the result in hexadecimal, decimal and binary. The hex value is padded to the full width, so a 16-bit result always shows four digits.
  4. If you were given a checksum and do not know which algorithm made it, use "Which CRC is this?". Paste the expected value in hex and the tool lists every catalogue algorithm that produces exactly that value for the current input.
  5. The "All algorithms at once" table shows the result of every preset for the same bytes, which is a quick way to compare variants.

Examples

The standard check string

The text 123456789 is the universal test vector. These are the values you should get:

CRC-32/ISO-HDLC  CBF43926
CRC-32/ISCSI     E3069283
CRC-16/IBM-3740  29B1
CRC-16/MODBUS    4B37
CRC-8/SMBUS      F4
CRC-64/XZ        995DC9BBDF1939FA

If your own implementation disagrees with these on that string, the parameters differ, not the data.

A familiar sentence

For the input The quick brown fox jumps over the lazy dog as UTF-8 text:

CRC-32/ISO-HDLC  414FA339
CRC-32/ISCSI     22620404
CRC-16/MODBUS    A89C
CRC-16/IBM-3740  8FDD

A Modbus request frame

Switch the input to hex bytes and enter 01 03 00 00 00 0A, a "read 10 holding registers" request to device 1. With CRC-16/MODBUS the result is CDC5. On the wire Modbus sends the low byte first, so the frame ends with C5 CD.

Identifying an unknown checksum

With 123456789 as input, paste 0xCBF43926 into "Which CRC is this?". Only CRC-32/ISO-HDLC matches. Paste 29B1 and only CRC-16/IBM-3740 matches. When several names appear, they are different algorithms that happen to give the same value for that input; try another input to separate them.

Common mistakes

  • Mixing up byte order. The value CDC5 is a number. Whether a protocol transmits CD C5 or C5 CD is a property of the protocol, not of the CRC.
  • Hashing the text when the device hashes bytes. Text mode uses UTF-8. A string with accents or emoji becomes more than one byte per character, so compare it with a hex input if the device uses another encoding.
  • Including or excluding the CRC field. Compute over the payload only. Many protocols also exclude the start byte or the length field. Check the specification.
  • Odd number of hex digits. Each byte needs two digits. The tool reports the character it cannot read, or the odd count, instead of guessing.
  • Custom parameters out of range. The polynomial must be non-zero and fit in the width, and the initial value and final XOR must fit as well. The width must be a whole number from 3 to 64.
  • Trusting the name. Documents say "CRC-16" or "CCITT" for different things. Match the parameters or the check value, not the label.

Frequently asked questions

Is a CRC safe for passwords or signatures?

No. A CRC is linear and easy to forge, and it is short. It detects accidental corruption only. For integrity against an attacker use a cryptographic hash such as SHA-256, or a keyed one.

Why does my CRC-16 not match the other tool?

Almost always because the variant is different. CRC-16/XMODEM, CRC-16/IBM-3740, CRC-16/KERMIT and CRC-16/MODBUS use the same or similar polynomials but different initial values and reflection. Compare the result for 123456789 with the check values in the catalogue to find which one your other tool computes.

Can it handle a large file?

Files are read in the browser and processed in memory, so the limit is what your device can hold. Nothing is uploaded. For cryptographic digests of files, see the file hash tool.

What is the largest CRC supported?

64 bits, for custom parameters and for the catalogue. Results are computed with exact big-integer arithmetic, so CRC-64 values are not rounded.

Does it show the intermediate steps?

No. It shows the final value in three bases and the matches. To inspect the bytes you are feeding in, the hex text converter helps.

Report a problem