CRC and Checksum Calculator

Text is encoded as UTF-8. For line endings or binary data, choose Hex bytes and type pairs such as 0D 0A.

Paste the received checksum in hex to verify it.

Enter data to see its checksum.

No valid result to draw.

Calculation needs JavaScript. If it does not load, the explanation, parameter table and examples below remain available.

Calculate or verify CRC-8, CRC-16 and CRC-32 values and simple 8-bit checksums for text or hex bytes, using catalogued CRC parameters.

How to use

Choose the algorithm your protocol or file format uses. The parameter card shows its width, polynomial, initial value, reflection and final XOR, so you can match it to a datasheet.

Choose whether you are entering text or hex bytes, then enter the data. The checksum updates as you type; changing the format keeps the same bytes.

To verify received data, paste the received checksum into Expected checksum. The tool reports Match or Mismatch.

Check the byte order your protocol transmits: the result is shown as big-endian and little-endian bytes.

If your implementation disagrees, compare its value after each byte with the running checksum table. For an unlisted CRC, choose Custom CRC and enter its parameters.

Science

A cyclic redundancy check treats the message bits as the coefficients of a polynomial and divides it by a fixed generator polynomial using arithmetic without carries, where addition and subtraction are both XOR. The remainder is the CRC. The receiver repeats the division; a different remainder means the data changed.

Many standards share a polynomial but differ in the register's initial value, whether each byte is processed least significant bit first (reflected), whether the result is reflected, and a final XOR. The Rocksoft model names these six parameters, and Greg Cook's catalogue lists them for over a hundred standards with a check value: the CRC of the ASCII text 123456789.

A CRC of width W detects every error burst no longer than W bits, and the common polynomials detect all errors of a few bits in short messages. A simple sum or XOR checksum misses errors that cancel. Two's-complement sums are still common in formats such as Intel HEX, where adding all bytes, including the checksum, gives zero.

The byte order of the transmitted CRC is set by the protocol, not by the algorithm. Modbus RTU sends the CRC-16/MODBUS low byte first, while many CRC-32 file formats store it big-endian.

Limitations: results are exact for the listed algorithms and for any custom CRC of width 8, 16 or 32. The tool does not cover other widths, Fletcher or Adler checksums, or cryptographic hashes, and it cannot detect deliberate tampering: a CRC is not a security check.

Text is encoded as UTF-8, so characters outside ASCII use two to four bytes, and a single-line field cannot hold line breaks. The same text in another encoding, or with different line endings, gives a different checksum. Use hex input, such as 0D 0A for CR LF, to control the exact bytes.

Formulas

CRC: Remainder of (message ร— x^W, preset by init) รท (x^W + G), with optional reflection and a final XOR

Register step: r = (r << 1) XOR G if the top bit is 1, else r << 1, kept to W bits

Sum-8: s = (d1 + d2 + โ€ฆ + dn) mod 256

Two's-complement Sum-8: t = (โˆ’(d1 + โ€ฆ + dn)) mod 256

Check value: CRC of the ASCII bytes 31 32 33 34 35 36 37 38 39

CRC-8/SMBUS: width 8, poly 0x07, init 0x00, refin false, refout false, xorout 0x00, check 0xF4

CRC-8/MAXIM-DOW: width 8, poly 0x31, init 0x00, refin true, refout true, xorout 0x00, check 0xA1

CRC-16/IBM-3740: width 16, poly 0x1021, init 0xFFFF, refin false, refout false, xorout 0x0000, check 0x29B1

CRC-16/KERMIT: width 16, poly 0x1021, init 0x0000, refin true, refout true, xorout 0x0000, check 0x2189

CRC-16/MODBUS: width 16, poly 0x8005, init 0xFFFF, refin true, refout true, xorout 0x0000, check 0x4B37

CRC-16/XMODEM: width 16, poly 0x1021, init 0x0000, refin false, refout false, xorout 0x0000, check 0x31C3

CRC-32/ISO-HDLC: width 32, poly 0x04C11DB7, init 0xFFFFFFFF, refin true, refout true, xorout 0xFFFFFFFF, check 0xCBF43926

CRC-32/ISCSI: width 32, poly 0x1EDC6F41, init 0xFFFFFFFF, refin true, refout true, xorout 0xFFFFFFFF, check 0xE3069283

Examples

CRC-32/ISO-HDLC, text 123456789: 0xCBF43926. This matches the catalogue check value and zlib's crc32, the CRC used by ZIP, PNG and Ethernet.

CRC-16/MODBUS, hex 01 03 00 00 00 01: 0x0A84; sent as 84 0A. A Modbus RTU read request. The low byte is transmitted first, so the frame ends 84 0A.

CRC-16/IBM-3740 versus CRC-16/KERMIT, text 123456789: 0x29B1 versus 0x2189. Common mistake: both are often called CRC-CCITT. The same polynomial 0x1021 gives different results because the initial value and reflection differ.

Two's-complement Sum-8, hex 03 00 30 00 02 33 7A: 0x1E. The Intel HEX record :0300300002337A1E. The bytes plus 1E sum to 0 modulo 256.

References

Greg Cook: Catalogue of parametrised CRC algorithms

Ross Williams: A Painless Guide to CRC Error Detection Algorithms (archived)

Koopman and Chakravarty: CRC polynomial selection for embedded networks

Python zlib.crc32 documentation

Modbus over Serial Line specification V1.02