You are offline. The tools work from the copy saved in this browser; pages you have not opened yet need a connection.
CRC-8 / CRC-16 / CRC-32 Calculator
Type text or paste hex bytes. You get the CRC for every named algorithm of the chosen width, can set your own parameters, and if you know the CRC a device sends, the tool finds which algorithm it is.
Data
ExampleText is taken as UTF-8 bytes; a line break counts as 0A. Hex: 01 03 00 6B, 0103006B and 0x01,0x03 all work.
If you have data with its CRC, for example from a device manual or a captured message, enter the CRC in hex. Every algorithm that gives it is marked, also with the bytes reversed.
CRC for all algorithms
| Algorithm | CRC |
|---|
Names and parameters follow the CRC RevEng catalogue. A marked row gives the known CRC; when it matched with the bytes reversed, the arrow shows that order.
Own parameters
| CRC | |
|---|---|
| Decimal | |
| Bytes, high byte first | |
| Bytes, low byte first | |
| Check ("123456789") | |
| Known as |
Write the polynomial in normal form without the top bit, as datasheets do: 0x8005, not the reversed 0xA001. Compare the check value with your documentation to be sure the parameters are right.
Runs entirely in your browser. Nothing you enter is sent to a server.
CRC catalogue: parameters and check values
All 113 algorithms of the CRC RevEng catalogue by Greg Cook. Check is the CRC of the ASCII text 123456789.
| Algorithm | Bits | poly | init | refin | refout | xorout | Check | Also known as |
|---|---|---|---|---|---|---|---|---|
| CRC-3/GSM | 3 | 0x3 | 0x0 | false | false | 0x7 | 0x4 | |
| CRC-3/ROHC | 3 | 0x3 | 0x7 | true | true | 0x0 | 0x6 | |
| CRC-4/G-704 | 4 | 0x3 | 0x0 | true | true | 0x0 | 0x7 | CRC-4/ITU |
| CRC-4/INTERLAKEN | 4 | 0x3 | 0xF | false | false | 0xF | 0xB | |
| CRC-5/EPC-C1G2 | 5 | 0x09 | 0x09 | false | false | 0x00 | 0x00 | CRC-5/EPC |
| CRC-5/G-704 | 5 | 0x15 | 0x00 | true | true | 0x00 | 0x07 | CRC-5/ITU |
| CRC-5/USB | 5 | 0x05 | 0x1F | true | true | 0x1F | 0x19 | |
| CRC-6/CDMA2000-A | 6 | 0x27 | 0x3F | false | false | 0x00 | 0x0D | |
| CRC-6/CDMA2000-B | 6 | 0x07 | 0x3F | false | false | 0x00 | 0x3B | |
| CRC-6/DARC | 6 | 0x19 | 0x00 | true | true | 0x00 | 0x26 | |
| CRC-6/G-704 | 6 | 0x03 | 0x00 | true | true | 0x00 | 0x06 | CRC-6/ITU |
| CRC-6/GSM | 6 | 0x2F | 0x00 | false | false | 0x3F | 0x13 | |
| CRC-7/MMC | 7 | 0x09 | 0x00 | false | false | 0x00 | 0x75 | CRC-7 |
| CRC-7/ROHC | 7 | 0x4F | 0x7F | true | true | 0x00 | 0x53 | |
| CRC-7/UMTS | 7 | 0x45 | 0x00 | false | false | 0x00 | 0x61 | |
| CRC-8/AUTOSAR | 8 | 0x2F | 0xFF | false | false | 0xFF | 0xDF | |
| CRC-8/BLUETOOTH | 8 | 0xA7 | 0x00 | true | true | 0x00 | 0x26 | |
| CRC-8/CDMA2000 | 8 | 0x9B | 0xFF | false | false | 0x00 | 0xDA | |
| CRC-8/DARC | 8 | 0x39 | 0x00 | true | true | 0x00 | 0x15 | |
| CRC-8/DVB-S2 | 8 | 0xD5 | 0x00 | false | false | 0x00 | 0xBC | |
| CRC-8/GSM-A | 8 | 0x1D | 0x00 | false | false | 0x00 | 0x37 | |
| CRC-8/GSM-B | 8 | 0x49 | 0x00 | false | false | 0xFF | 0x94 | |
| CRC-8/HITAG | 8 | 0x1D | 0xFF | false | false | 0x00 | 0xB4 | |
| CRC-8/I-432-1 | 8 | 0x07 | 0x00 | false | false | 0x55 | 0xA1 | CRC-8/ITU |
| CRC-8/I-CODE | 8 | 0x1D | 0xFD | false | false | 0x00 | 0x7E | |
| CRC-8/LTE | 8 | 0x9B | 0x00 | false | false | 0x00 | 0xEA | |
| CRC-8/MAXIM-DOW | 8 | 0x31 | 0x00 | true | true | 0x00 | 0xA1 | CRC-8/MAXIM, DOW-CRC |
| CRC-8/MIFARE-MAD | 8 | 0x1D | 0xC7 | false | false | 0x00 | 0x99 | |
| CRC-8/NRSC-5 | 8 | 0x31 | 0xFF | false | false | 0x00 | 0xF7 | |
| CRC-8/OPENSAFETY | 8 | 0x2F | 0x00 | false | false | 0x00 | 0x3E | |
| CRC-8/ROHC | 8 | 0x07 | 0xFF | true | true | 0x00 | 0xD0 | |
| CRC-8/SAE-J1850 | 8 | 0x1D | 0xFF | false | false | 0xFF | 0x4B | |
| CRC-8/SMBUS | 8 | 0x07 | 0x00 | false | false | 0x00 | 0xF4 | CRC-8 |
| CRC-8/TECH-3250 | 8 | 0x1D | 0xFF | true | true | 0x00 | 0x97 | CRC-8/AES, CRC-8/EBU |
| CRC-8/WCDMA | 8 | 0x9B | 0x00 | true | true | 0x00 | 0x25 | |
| CRC-10/ATM | 10 | 0x233 | 0x000 | false | false | 0x000 | 0x199 | CRC-10, CRC-10/I-610 |
| CRC-10/CDMA2000 | 10 | 0x3D9 | 0x3FF | false | false | 0x000 | 0x233 | |
| CRC-10/GSM | 10 | 0x175 | 0x000 | false | false | 0x3FF | 0x12A | |
| CRC-11/FLEXRAY | 11 | 0x385 | 0x01A | false | false | 0x000 | 0x5A3 | CRC-11 |
| CRC-11/UMTS | 11 | 0x307 | 0x000 | false | false | 0x000 | 0x061 | |
| CRC-12/CDMA2000 | 12 | 0xF13 | 0xFFF | false | false | 0x000 | 0xD4D | |
| CRC-12/DECT | 12 | 0x80F | 0x000 | false | false | 0x000 | 0xF5B | X-CRC-12 |
| CRC-12/GSM | 12 | 0xD31 | 0x000 | false | false | 0xFFF | 0xB34 | |
| CRC-12/UMTS | 12 | 0x80F | 0x000 | false | true | 0x000 | 0xDAF | CRC-12/3GPP |
| CRC-13/BBC | 13 | 0x1CF5 | 0x0000 | false | false | 0x0000 | 0x04FA | |
| CRC-14/DARC | 14 | 0x0805 | 0x0000 | true | true | 0x0000 | 0x082D | |
| CRC-14/GSM | 14 | 0x202D | 0x0000 | false | false | 0x3FFF | 0x30AE | |
| CRC-15/CAN | 15 | 0x4599 | 0x0000 | false | false | 0x0000 | 0x059E | CRC-15 |
| CRC-15/MPT1327 | 15 | 0x6815 | 0x0000 | false | false | 0x0001 | 0x2566 | |
| CRC-16/ARC | 16 | 0x8005 | 0x0000 | true | true | 0x0000 | 0xBB3D | ARC, CRC-16, CRC-16/LHA, CRC-IBM |
| CRC-16/CDMA2000 | 16 | 0xC867 | 0xFFFF | false | false | 0x0000 | 0x4C06 | |
| CRC-16/CMS | 16 | 0x8005 | 0xFFFF | false | false | 0x0000 | 0xAEE7 | |
| CRC-16/DDS-110 | 16 | 0x8005 | 0x800D | false | false | 0x0000 | 0x9ECF | |
| CRC-16/DECT-R | 16 | 0x0589 | 0x0000 | false | false | 0x0001 | 0x007E | R-CRC-16 |
| CRC-16/DECT-X | 16 | 0x0589 | 0x0000 | false | false | 0x0000 | 0x007F | X-CRC-16 |
| CRC-16/DNP | 16 | 0x3D65 | 0x0000 | true | true | 0xFFFF | 0xEA82 | |
| CRC-16/EN-13757 | 16 | 0x3D65 | 0x0000 | false | false | 0xFFFF | 0xC2B7 | |
| CRC-16/GENIBUS | 16 | 0x1021 | 0xFFFF | false | false | 0xFFFF | 0xD64E | CRC-16/DARC, CRC-16/EPC, CRC-16/EPC-C1G2, CRC-16/I-CODE |
| CRC-16/GSM | 16 | 0x1021 | 0x0000 | false | false | 0xFFFF | 0xCE3C | |
| CRC-16/IBM-3740 | 16 | 0x1021 | 0xFFFF | false | false | 0x0000 | 0x29B1 | CRC-16/AUTOSAR, CRC-16/CCITT-FALSE |
| CRC-16/IBM-SDLC | 16 | 0x1021 | 0xFFFF | true | true | 0xFFFF | 0x906E | CRC-16/ISO-HDLC, CRC-16/ISO-IEC-14443-3-B, CRC-16/X-25, CRC-B, X-25 |
| CRC-16/ISO-IEC-14443-3-A | 16 | 0x1021 | 0xC6C6 | true | true | 0x0000 | 0xBF05 | CRC-A |
| CRC-16/KERMIT | 16 | 0x1021 | 0x0000 | true | true | 0x0000 | 0x2189 | CRC-16/BLUETOOTH, CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-16/V-41-LSB, CRC-CCITT, KERMIT |
| CRC-16/LJ1200 | 16 | 0x6F63 | 0x0000 | false | false | 0x0000 | 0xBDF4 | |
| CRC-16/M17 | 16 | 0x5935 | 0xFFFF | false | false | 0x0000 | 0x772B | |
| CRC-16/MAXIM-DOW | 16 | 0x8005 | 0x0000 | true | true | 0xFFFF | 0x44C2 | CRC-16/MAXIM |
| CRC-16/MCRF4XX | 16 | 0x1021 | 0xFFFF | true | true | 0x0000 | 0x6F91 | |
| CRC-16/MODBUS | 16 | 0x8005 | 0xFFFF | true | true | 0x0000 | 0x4B37 | MODBUS |
| CRC-16/NRSC-5 | 16 | 0x080B | 0xFFFF | true | true | 0x0000 | 0xA066 | |
| CRC-16/OPENSAFETY-A | 16 | 0x5935 | 0x0000 | false | false | 0x0000 | 0x5D38 | |
| CRC-16/OPENSAFETY-B | 16 | 0x755B | 0x0000 | false | false | 0x0000 | 0x20FE | |
| CRC-16/PROFIBUS | 16 | 0x1DCF | 0xFFFF | false | false | 0xFFFF | 0xA819 | CRC-16/IEC-61158-2 |
| CRC-16/RIELLO | 16 | 0x1021 | 0xB2AA | true | true | 0x0000 | 0x63D0 | |
| CRC-16/SPI-FUJITSU | 16 | 0x1021 | 0x1D0F | false | false | 0x0000 | 0xE5CC | CRC-16/AUG-CCITT |
| CRC-16/T10-DIF | 16 | 0x8BB7 | 0x0000 | false | false | 0x0000 | 0xD0DB | |
| CRC-16/TELEDISK | 16 | 0xA097 | 0x0000 | false | false | 0x0000 | 0x0FB3 | |
| CRC-16/TMS37157 | 16 | 0x1021 | 0x89EC | true | true | 0x0000 | 0x26B1 | |
| CRC-16/UMTS | 16 | 0x8005 | 0x0000 | false | false | 0x0000 | 0xFEE8 | CRC-16/BUYPASS, CRC-16/VERIFONE |
| CRC-16/USB | 16 | 0x8005 | 0xFFFF | true | true | 0xFFFF | 0xB4C8 | |
| CRC-16/XMODEM | 16 | 0x1021 | 0x0000 | false | false | 0x0000 | 0x31C3 | CRC-16/ACORN, CRC-16/LTE, CRC-16/V-41-MSB, XMODEM, ZMODEM |
| CRC-17/CAN-FD | 17 | 0x1685B | 0x00000 | false | false | 0x00000 | 0x04F03 | |
| CRC-21/CAN-FD | 21 | 0x102899 | 0x000000 | false | false | 0x000000 | 0x0ED841 | |
| CRC-24/BLE | 24 | 0x00065B | 0x555555 | true | true | 0x000000 | 0xC25A56 | |
| CRC-24/FLEXRAY-A | 24 | 0x5D6DCB | 0xFEDCBA | false | false | 0x000000 | 0x7979BD | |
| CRC-24/FLEXRAY-B | 24 | 0x5D6DCB | 0xABCDEF | false | false | 0x000000 | 0x1F23B8 | |
| CRC-24/INTERLAKEN | 24 | 0x328B63 | 0xFFFFFF | false | false | 0xFFFFFF | 0xB4F3E6 | |
| CRC-24/LTE-A | 24 | 0x864CFB | 0x000000 | false | false | 0x000000 | 0xCDE703 | |
| CRC-24/LTE-B | 24 | 0x800063 | 0x000000 | false | false | 0x000000 | 0x23EF52 | |
| CRC-24/OPENPGP | 24 | 0x864CFB | 0xB704CE | false | false | 0x000000 | 0x21CF02 | CRC-24 |
| CRC-24/OS-9 | 24 | 0x800063 | 0xFFFFFF | false | false | 0xFFFFFF | 0x200FA5 | |
| CRC-30/CDMA | 30 | 0x2030B9C7 | 0x3FFFFFFF | false | false | 0x3FFFFFFF | 0x04C34ABF | |
| CRC-31/PHILIPS | 31 | 0x04C11DB7 | 0x7FFFFFFF | false | false | 0x7FFFFFFF | 0x0CE9E46C | |
| CRC-32/AIXM | 32 | 0x814141AB | 0x00000000 | false | false | 0x00000000 | 0x3010BF7F | CRC-32Q |
| CRC-32/AUTOSAR | 32 | 0xF4ACFB13 | 0xFFFFFFFF | true | true | 0xFFFFFFFF | 0x1697D06A | |
| CRC-32/BASE91-D | 32 | 0xA833982B | 0xFFFFFFFF | true | true | 0xFFFFFFFF | 0x87315576 | CRC-32D |
| CRC-32/BZIP2 | 32 | 0x04C11DB7 | 0xFFFFFFFF | false | false | 0xFFFFFFFF | 0xFC891918 | CRC-32/AAL5, CRC-32/DECT-B, B-CRC-32 |
| CRC-32/CD-ROM-EDC | 32 | 0x8001801B | 0x00000000 | true | true | 0x00000000 | 0x6EC2EDC4 | |
| CRC-32/CKSUM | 32 | 0x04C11DB7 | 0x00000000 | false | false | 0xFFFFFFFF | 0x765E7680 | CKSUM, CRC-32/POSIX |
| CRC-32/ISCSI | 32 | 0x1EDC6F41 | 0xFFFFFFFF | true | true | 0xFFFFFFFF | 0xE3069283 | CRC-32/BASE91-C, CRC-32/CASTAGNOLI, CRC-32/INTERLAKEN, CRC-32C, CRC-32/NVME |
| CRC-32/ISO-HDLC | 32 | 0x04C11DB7 | 0xFFFFFFFF | true | true | 0xFFFFFFFF | 0xCBF43926 | CRC-32, CRC-32/ADCCP, CRC-32/V-42, CRC-32/XZ, PKZIP |
| CRC-32/JAMCRC | 32 | 0x04C11DB7 | 0xFFFFFFFF | true | true | 0x00000000 | 0x340BC6D9 | JAMCRC |
| CRC-32/MEF | 32 | 0x741B8CD7 | 0xFFFFFFFF | true | true | 0x00000000 | 0xD2C22F51 | |
| CRC-32/MPEG-2 | 32 | 0x04C11DB7 | 0xFFFFFFFF | false | false | 0x00000000 | 0x0376E6E7 | |
| CRC-32/XFER | 32 | 0x000000AF | 0x00000000 | false | false | 0x00000000 | 0xBD0BE338 | XFER |
| CRC-40/GSM | 40 | 0x0004820009 | 0x0000000000 | false | false | 0xFFFFFFFFFF | 0xD4164FC646 | |
| CRC-64/ECMA-182 | 64 | 0x42F0E1EBA9EA3693 | 0x0000000000000000 | false | false | 0x0000000000000000 | 0x6C40DF5F0B497347 | CRC-64 |
| CRC-64/GO-ISO | 64 | 0x000000000000001B | 0xFFFFFFFFFFFFFFFF | true | true | 0xFFFFFFFFFFFFFFFF | 0xB90956C775A41001 | |
| CRC-64/MS | 64 | 0x259C84CBA6426349 | 0xFFFFFFFFFFFFFFFF | true | true | 0x0000000000000000 | 0x75D4B74F024ECEEA | |
| CRC-64/NVME | 64 | 0xAD93D23594C93659 | 0xFFFFFFFFFFFFFFFF | true | true | 0xFFFFFFFFFFFFFFFF | 0xAE8B14860A799888 | |
| CRC-64/REDIS | 64 | 0xAD93D23594C935A9 | 0x0000000000000000 | true | true | 0x0000000000000000 | 0xE9C6D914C4B8D9CA | |
| CRC-64/WE | 64 | 0x42F0E1EBA9EA3693 | 0xFFFFFFFFFFFFFFFF | false | false | 0xFFFFFFFFFFFFFFFF | 0x62EC59E3F1A4F00A | |
| CRC-64/XZ | 64 | 0x42F0E1EBA9EA3693 | 0xFFFFFFFFFFFFFFFF | true | true | 0xFFFFFFFFFFFFFFFF | 0x995DC9BBDF1939FA | CRC-64/GO-ECMA |
| CRC-82/DARC | 82 | 0x0308C0111011401440411 | 0x000000000000000000000 | true | true | 0x000000000000000000000 | 0x09EA83F625023801FD612 |
Any CRC in Python
The same bit-by-bit algorithm the calculator uses. Take the parameters from the table above.
def crc(data: bytes, width, poly, init, refin, refout, xorout):
top, mask = 1 << (width - 1), (1 << width) - 1
reg = init
for byte in data:
for k in range(8):
bit = (byte >> k) & 1 if refin else (byte >> (7 - k)) & 1
feedback = bool(reg & top) ^ bit
reg = (reg << 1) & mask
if feedback:
reg ^= poly
if refout:
reg = int(f"{reg:0{width}b}"[::-1], 2)
return reg ^ xorout
# CRC-16/MODBUS of "123456789" -> 0x4b37
print(hex(crc(b"123456789", 16, 0x8005, 0xFFFF, True, True, 0x0000)))
How a CRC is described
A CRC (cyclic redundancy check) is a checksum calculated by polynomial division of the data. A name like “CRC-16” is not enough to compute it. You need six parameters, in the model by Ross Williams that the RevEng catalogue uses: width in bits, poly (the generator polynomial in normal form), init (start value of the register), refin (each input byte is processed least significant bit first), refout (the result is reversed bit by bit) and xorout (a value XORed onto the result). The check value, the CRC of the ASCII text 123456789, tells you whether an implementation is right.
Modbus RTU, for example, uses CRC-16/MODBUS: width 16, poly 0x8005, init 0xFFFF, refin and refout true, xorout 0. CRC-16/ARC has the same polynomial but starts at 0, so it gives a completely different result. For Modbus frames there is a dedicated Modbus CRC-16 calculator that also checks whole frames.
Common mistakes
- Ambiguous names. “CRC-16” usually means CRC-16/ARC. “CRC-CCITT” can mean CRC-16/KERMIT (check 0x2189), CRC-16/IBM-3740, also called CCITT-FALSE (0x29B1), or CRC-16/XMODEM (0x31C3). Compare the check value in the documentation, not the name.
- Reversed polynomial. Source code often uses the reflected form: 0xA001 is 0x8005 reversed, 0xEDB88320 is 0x04C11DB7. Enter the normal form here and set refin and refout.
- Byte order of the result. Reflected CRCs are usually sent low byte first; Modbus sends CRC 0x4B37 as 37 4B. Enter a known CRC as you see it, the tool also tries the bytes reversed.
- Text instead of bytes. “01 03” typed as text is five ASCII bytes, not two. For messages from a log, switch the input to hex bytes.
- Wrong part of the message. Devices differ in what the CRC covers: with or without the address, a start byte (STX, 0x68), the length, or a header. If nothing matches, try leaving out the first bytes.
Questions from practice
What is the difference between CRC-16/MODBUS and CRC-16/ARC?
Both use the polynomial 0x8005, reflected, but MODBUS starts with 0xFFFF and ARC with 0x0000. For 123456789 MODBUS gives 0x4B37 and ARC 0xBB3D. Modbus RTU always uses CRC-16/MODBUS and sends the low byte first.
Which CRC-32 is the usual one?
CRC-32/ISO-HDLC, used by Ethernet, ZIP, PNG and zlib: poly 0x04C11DB7, init and xorout 0xFFFFFFFF, reflected, check 0xCBF43926. CRC-32C (Castagnoli, CRC-32/ISCSI) is a different polynomial used by iSCSI and SCTP. CRC-32/BZIP2 and CRC-32/MPEG-2 use the usual polynomial without reflection.
How do I find out which CRC a device uses?
Take one complete message from the manual or a capture. Enter the data without the CRC and type the CRC from the message into Known CRC. Every algorithm that gives it is marked, also when the bytes come in the opposite order. If nothing matches, the CRC probably covers a different part of the message, so try leaving out the first byte or a start character.
Why does another calculator give a different CRC?
Usually because of the input: text versus hex bytes, a hidden line break at the end, or spaces counted as characters. The other common reason is a different variant under the same name. Compare the check value for 123456789 to see whether two tools use the same algorithm.
What do refin and refout mean?
refin = true means each data byte is processed starting with its least significant bit, the order in which a UART sends it. refout = true means the final register is reversed bit by bit. Modbus and the usual CRC-32 have both true; CRC-16/XMODEM and CRC-16/IBM-3740 have both false.
Related tools
- 4–20 mA ScalingRaw values to engineering units, 0–10 V and 4–20 mA with fault detection.
- IEEE 754 ConverterFloat32 and Float64 to hex and back, bit by bit, with registers for every byte order.
- S5TIME / DT / DTL ConverterSiemens S7 time formats: S5TIME, TIME, DATE, TOD, DATE_AND_TIME and DTL to raw hex and Modbus registers and back.
- P1 Telegram Decoder (DSMR)Decode a smart meter P1 telegram (DSMR, Belgian e-MUCS): OBIS codes, CRC check, power per phase, gas and water.
- Pt100 / Pt1000 CalculatorResistance to temperature and back per IEC 60751, with 2-wire lead error and tolerance classes.
- Thermocouple CalculatormV to °C and back for types K, J, T, E, N, R, S and B, with cold junction compensation.
- Register DecoderFloat32, Int32, UInt16 and bits in every byte order, plus Find my value.
- Address Converter40001 ↔ offset 0, 4x/3x/0x/1x notation, 5- and 6-digit addresses.
- Value EncoderTurn a value like 230.5 into registers for every byte order.
- CRC-16 CalculatorModbus RTU checksum in wire order, plus a full frame check.
- Frame DecoderRead RTU and TCP frames from Wireshark or a serial log.
- Request GeneratorRead and write requests in RTU, TCP and ASCII, plus a check of the reply.
- Frame ConverterThe same Modbus frame as RTU, TCP and ASCII, with CRC, header and LRC recalculated.
- Function & Exception CodesWhat each code means and the usual cause in practice.
- Status Word DecoderName each bit of a 16- or 32-bit status register.
- Modbus RTU Timing CalculatorCharacter time, t1.5 and t3.5, frame length, shortest timeout and how many reads per second fit on the line.
- Register mapsReady-made register maps for meters, inverters and batteries.