Xerobit

CRC Calculator: CRC-8, CRC-16, CRC-32 and CRC-64

Enter text or hex bytes and this CRC calculator returns CRC-8, four CRC-16 variants, CRC-32, CRC-32C and two CRC-64 variants, all named as in the CRC catalogue. It runs in your browser and nothing is uploaded.

Text is converted to UTF-8 bytes. Choose Hex bytes to enter raw bytes.

Result

  • CRC-8/SMBUS
    0xF4
  • CRC-16/CCITT-FALSE
    0x29B1
  • CRC-16/XMODEM
    0x31C3
  • CRC-16/MODBUS
    0x4B37
  • CRC-16/ARC
    0xBB3D
  • CRC-32
    0xCBF43926
  • CRC-32C
    0xE3069283
  • CRC-64/XZ
    0x995DC9BBDF1939FA
  • CRC-64/ECMA-182
    0x6C40DF5F0B497347

9 bytes processed.

How to use the crc calculator

  1. Type or paste your data into the Input box. Use Hex bytes as the input format for raw bytes such as a Modbus frame.
  2. Leave Algorithm on All algorithms to see every variant, or pick one to see just that checksum.
  3. The results update as you type and are shown as hexadecimal with a 0x prefix, padded to the full width of the CRC.
  4. Copy the value you need into your protocol code, file header or test.

How a cyclic redundancy check works

A cyclic redundancy check treats the message as one long binary number and divides it by a fixed generator polynomial using XOR instead of subtraction. The remainder is the checksum. Because there are no carries, the division is cheap in hardware shift registers and in software with a 256-entry lookup table, which is how this crc calculator works.

Every CRC is defined by five parameters: the width, the polynomial, the initial register value, whether input and output bits are reflected, and a final XOR mask. CRC-32, for example, uses the polynomial 0x04C11DB7, starts from 0xFFFFFFFF, processes each byte least significant bit first, and XORs the result with 0xFFFFFFFF at the end. For the ASCII string "123456789" it gives 0xCBF43926. Change any one parameter and you get a different, equally valid CRC with a different name.

Supported CRC algorithms and check values

This calculator implements nine variants with the parameters used by the CRC catalogue (reveng). The Check column is the result for the nine ASCII bytes "123456789", the standard test string, so you can confirm your own implementation or another tool against it.

AlgorithmPolyInitReflectedXorOutCheck
CRC-8/SMBUS0x070x00No0x000xF4
CRC-16/CCITT-FALSE0x10210xFFFFNo0x00000x29B1
CRC-16/XMODEM0x10210x0000No0x00000x31C3
CRC-16/MODBUS0x80050xFFFFYes0x00000x4B37
CRC-16/ARC0x80050x0000Yes0x00000xBB3D
CRC-320x04C11DB70xFFFFFFFFYes0xFFFFFFFF0xCBF43926
CRC-32C0x1EDC6F410xFFFFFFFFYes0xFFFFFFFF0xE3069283
CRC-64/XZ0x42F0E1EBA9EA36930xFFFFFFFFFFFFFFFFYes0xFFFFFFFFFFFFFFFF0x995DC9BBDF1939FA
CRC-64/ECMA-1820x42F0E1EBA9EA36930x0000000000000000No0x00000000000000000x6C40DF5F0B497347

CRC-16/CCITT-FALSE is also catalogued as CRC-16/IBM-3740, and CRC-16/ARC as CRC-16/IBM. Names such as "CRC-16/CCITT" are used loosely by different vendors for XMODEM, CCITT-FALSE and others, which is why the full name matters.

Where each CRC is used

CRC-32 is the checksum in Ethernet frames, ZIP and gzip archives and PNG chunks. CRC-32C (Castagnoli) is used by iSCSI, SCTP and the ext4 and Btrfs file systems, and many CPUs have a dedicated instruction for it. CRC-16/MODBUS ends every Modbus RTU frame, sent low byte first, while XMODEM is the checksum of the old XMODEM file transfer protocol. CRC-8/SMBUS is the packet error code of the SMBus. CRC-64/XZ is the integrity check in the xz format, and CRC-64/ECMA-182 comes from the ECMA-182 tape standard.

A CRC detects accidental corruption such as flipped bits and burst errors up to the width of the CRC. It is not a security measure: anyone who knows the polynomial can craft data with a chosen CRC. For tamper detection use a keyed construction such as an HMAC SHA256 generator, and for a general-purpose digest see the hash generator.

Common mistakes when comparing CRC values

The most frequent cause of a mismatch is comparing two different variants that share a name or a polynomial. CRC-16/MODBUS and CRC-16/ARC use the same polynomial 0x8005 and both reflect, but start from different values (0xFFFF versus 0x0000). CRC-16/XMODEM and CRC-16/CCITT-FALSE share 0x1021 and differ only in the initial value. Always match all five parameters, not just the polynomial.

The second cause is the input bytes. Text is hashed here as UTF-8, so an accented letter is two bytes. If your device sends a binary frame, switch to hex input and enter the exact bytes, for example 01 03 00 00 00 0A; separators such as spaces, commas and colons are ignored. Also remember byte order: a Modbus frame carries its CRC-16 low byte first, so the request above has the CRC value 0xCDC5, which appears on the wire as C5 CD.

Finally, a CRC of an empty input is not always zero. CRC-32 of nothing is 0x00000000 only because the initial and final XOR values cancel; CRC-16/CCITT-FALSE of nothing is 0xFFFF.

What this calculator does not do

It computes one value over the whole input in one pass. It does not read files, so to checksum a file you need to paste its bytes as hex. It does not accept custom polynomials or parameters, and it does not cover the many other catalogued variants such as CRC-16/KERMIT, CRC-32/BZIP2 or CRC-24. Results are shown only as hexadecimal. It also does not compare two files or repair data: a CRC can say that data changed, not what changed.

Worked examples

ExampleInputResult
Check string 123456789Input: 123456789; Input format: text; Algorithm: allCRC-8/SMBUS: 0xF4; CRC-16/CCITT-FALSE: 0x29B1; CRC-16/XMODEM: 0x31C3; CRC-16/MODBUS: 0x4B37; CRC-16/ARC: 0xBB3D; CRC-32: 0xCBF43926; CRC-32C: 0xE3069283; CRC-64/XZ: 0x995DC9BBDF1939FA; CRC-64/ECMA-182: 0x6C40DF5F0B497347
Modbus RTU request frame (hex)Input: 01 03 00 00 00 0A; Input format: hex; Algorithm: crc16modbusCRC-16/MODBUS: 0xCDC5
Hello WorldInput: Hello World; Input format: text; Algorithm: allCRC-8/SMBUS: 0x25; CRC-16/CCITT-FALSE: 0x4D25; CRC-16/XMODEM: 0x992A; CRC-16/MODBUS: 0xDAED; CRC-16/ARC: 0x3EEB; CRC-32: 0x4A17B156; CRC-32C: 0x691DAA2F; CRC-64/XZ: 0x3E747467C7B5CDC6; CRC-64/ECMA-182: 0x976AB66E2EF68109
CRC-32C of a sentenceInput: The quick brown fox jumps over the lazy dog; Input format: text; Algorithm: crc32cCRC-32C: 0x22620404

FAQ

What is a CRC calculator used for?

It computes cyclic redundancy check values to detect accidental changes in data during transmission or storage. Typical uses are checking a protocol frame, verifying an archive entry or generating the check field of a message.

Why does my CRC differ from another tool?

Usually the other tool uses a different variant: a different initial value, reflection or final XOR. Compare the check value for "123456789" first. CRC-16/XMODEM is 0x31C3 and CRC-16/CCITT-FALSE is 0x29B1, for example, even though both use the polynomial 0x1021.

Is CRC secure against tampering?

No. A CRC only catches accidental errors, and an attacker can modify data and recompute a matching CRC. Use a cryptographic hash or an HMAC when integrity against an attacker matters.

What is the check value "123456789"?

It is the standard test input in the CRC catalogue. Each CRC variant has a published result for those nine ASCII bytes, so it is the quickest way to confirm that an implementation uses the right parameters.

What is the difference between CRC-32 and CRC-32C?

They use different polynomials. CRC-32 uses 0x04C11DB7 (Ethernet, ZIP, PNG) and CRC-32C uses 0x1EDC6F41 (Castagnoli, iSCSI, ext4), which detects more error patterns for some message lengths and has CPU instruction support.

Does this tool upload my data?

No. The calculation runs in your browser with JavaScript, and your input never leaves your device.