CRC Calculator Online — CRC-8, CRC-16, CRC-32 & Modbus
Free CRC calculator: CRC-8, CRC-16 Modbus, CCITT, CRC-32 and CRC-32C. Text or hex input, HEX/DEC/BIN output. Runs in your browser, no upload.
Last updated:
Was this tool useful?
Use the tool above and you can rate it here.
How the CRC Calculator works
The CRC calculator generates cyclic redundancy check values for text or hexadecimal data using ten standard CRC algorithms — CRC-8, CRC-8/MAXIM, CRC-16/IBM, CRC-16/CCITT, CRC-16/MODBUS, CRC-16/X-25, CRC-16/DNP, CRC-32, CRC-32C, and CRC-32/BZIP2. Results are shown simultaneously in hexadecimal, decimal, and binary. The “All Algorithms” mode calculates every variant live as you type — useful when you have an unknown CRC and need to identify which algorithm produced it.
CRC replaces costly error-checking with a compact polynomial remainder — computed at both sender and receiver.
How CRC polynomial division works
CRC treats the input data as a large binary polynomial and divides it by a generator polynomial using modulo-2 arithmetic (XOR with no carries). The remainder from this division is the CRC value. A CRC-16 remainder is 16 bits wide; CRC-32 produces a 32-bit remainder. At the receiver, the same division is performed — a zero remainder (or a fixed “residue” for some algorithms) confirms the data arrived without errors.
Algorithm comparison — all supported variants
| Algorithm | Width | Polynomial | Init | RefIn | XorOut | Used in |
|---|---|---|---|---|---|---|
| CRC-8 | 8-bit | 0x07 | 0x00 | No | 0x00 | I²C, ATM, DVB |
| CRC-8/MAXIM | 8-bit | 0x31 | 0x00 | Yes | 0x00 | 1-Wire, iButton |
| CRC-16/IBM | 16-bit | 0x8005 | 0x0000 | Yes | 0x0000 | USB, ARC, IBM BISYNC |
| CRC-16/CCITT | 16-bit | 0x1021 | 0xFFFF | No | 0x0000 | XMODEM, Bluetooth, SD |
| CRC-16/MODBUS | 16-bit | 0x8005 | 0xFFFF | Yes | 0x0000 | Modbus RTU, industrial |
| CRC-16/X-25 | 16-bit | 0x1021 | 0xFFFF | Yes | 0xFFFF | PPP, HDLC, X.25 |
| CRC-16/DNP | 16-bit | 0x3D65 | 0x0000 | Yes | 0xFFFF | DNP3, SCADA |
| CRC-32 | 32-bit | 0x04C11DB7 | 0xFFFFFFFF | Yes | 0xFFFFFFFF | Ethernet, ZIP, PNG |
| CRC-32C | 32-bit | 0x1EDC6F41 | 0xFFFFFFFF | Yes | 0xFFFFFFFF | iSCSI, SCTP, Btrfs |
| CRC-32/BZIP2 | 32-bit | 0x04C11DB7 | 0xFFFFFFFF | No | 0xFFFFFFFF | bzip2, AAL5, DECT |
CRC in Modbus RTU
Modbus RTU uses a 16-bit CRC appended to every frame. Per the MODBUS over Serial Line Specification and Implementation Guide published by Modbus.org, the Modbus CRC-16 starts with an initial value of 0xFFFF, uses polynomial 0x8005 in reflected (LSB-first) form, and XORs with 0x0000 at the end. The two CRC bytes are written low byte first, then high byte. The calculator's CRC-16/MODBUS preset produces the correct bytes in the right order for direct frame insertion.
Error detection capability
CRC-32 detects all single and double-bit errors, all odd-number bit errors, all burst errors up to 32 bits, and the vast majority of longer burst errors. The probability of an undetected random error is 1 − 2⁻³² ≈ 99.9999998%. CRC is appropriate for communication error detection but is not a cryptographic hash — it should not be used for security purposes. For integrity verification against intentional tampering, use SHA-256 or HMAC.
Code examples — CRC-32 and Modbus CRC-16
Python
def crc32(data: bytes) -> int:
"""CRC-32 — used in Ethernet, ZIP, PNG (poly 0x04C11DB7 reflected)"""
crc = 0xFFFFFFFF
for byte in data:
crc ^= byte
for _ in range(8):
crc = (crc >> 1) ^ (0xEDB88320 & -(crc & 1))
return crc ^ 0xFFFFFFFF
def modbus_crc16(data: bytes) -> int:
"""Modbus CRC-16 — poly 0x8005 reflected, init 0xFFFF"""
crc = 0xFFFF
for byte in data:
crc ^= byte
for _ in range(8):
crc = (crc >> 1) ^ (0xA001 & -(crc & 1))
return crc
# Usage
data = b"Hello, World!"
print(f"CRC-32: 0x{crc32(data):08X}")
print(f"Modbus CRC-16: 0x{modbus_crc16(data):04X}")
# Append to Modbus frame: low byte first, then high byte
crc = modbus_crc16(data)
frame = data + bytes([crc & 0xFF, (crc >> 8) & 0xFF])C
#include <stdint.h>
#include <stddef.h>
/* CRC-32 (Ethernet, ZIP, PNG) */
uint32_t crc32(const uint8_t *data, size_t len) {
uint32_t crc = 0xFFFFFFFF;
while (len--) {
crc ^= *data++;
for (int i = 0; i < 8; i++)
crc = (crc >> 1) ^ (0xEDB88320 & -(crc & 1));
}
return crc ^ 0xFFFFFFFF;
}
/* Modbus CRC-16 — append as {lo, hi} to every RTU frame */
uint16_t modbus_crc16(const uint8_t *data, size_t len) {
uint16_t crc = 0xFFFF;
while (len--) {
crc ^= *data++;
for (int i = 0; i < 8; i++)
crc = (crc >> 1) ^ (0xA001 & -(crc & 1));
}
return crc;
}Frequently asked questions
- What is a CRC?
- A Cyclic Redundancy Check (CRC) is an error-detecting code used to verify data integrity. A generator polynomial is applied to the data bytes via modulo-2 division, producing a fixed-length remainder (the CRC). Appending the CRC to a data frame lets the receiver recompute and compare — a mismatch means the data was corrupted in transit.
- Which CRC variant should I use?
- Match the variant required by your protocol. CRC-32 is used in Ethernet, ZIP, and PNG. CRC-16/MODBUS is the standard for Modbus RTU. CRC-16/CCITT and X-25 are used in HDLC, PPP, and SD cards. CRC-16/IBM appears in USB and legacy industrial protocols. CRC-8 is common in 1-Wire and SMBus. CRC-32C (Castagnoli) is used in iSCSI and SCTP.
- What is the Modbus CRC-16 formula?
- Modbus RTU uses CRC-16 with polynomial 0x8005, initial value 0xFFFF, reflected input and output (LSB-first), and XorOut of 0x0000. The two CRC bytes are appended low-byte first. The calculator's CRC-16/MODBUS preset applies these parameters exactly. Enter your frame bytes in hex mode (space-separated) to get the two bytes to append.
- What is the difference between reflected and non-reflected CRC?
- Reflected (LSB-first) CRC processes each byte starting from the least significant bit — used in CRC-32, CRC-16/MODBUS, and most Ethernet variants. Non-reflected (MSB-first) processes from the most significant bit — used in CRC-16/CCITT-FALSE and CRC-32/BZIP2. The RefIn and RefOut parameters control this; the calculator shows both values for whichever preset is selected.
- How do I verify a CRC checksum?
- Take the received data bytes without the appended CRC, run them through the same CRC algorithm, and compare your computed result to the received CRC. A match means the data arrived intact. For some algorithms, appending the CRC bytes and computing again produces a fixed constant (the residue) — a non-matching result indicates corruption.
- What is CRC-32 used for in ZIP and PNG files?
- ZIP stores a CRC-32 in each file header to verify extraction integrity — if the decompressed bytes produce a different CRC-32, the archive is corrupt. PNG stores CRC-32 at the end of every chunk to detect chunk-level corruption. Both use the standard CRC-32 polynomial 0x04C11DB7 with reflected bit order, matching the CRC-32 preset in this calculator.
- What is the difference between CRC and MD5 or SHA?
- CRC is designed for accidental error detection — it is fast, hardware-friendly, and excellent at catching noise and burst errors, but it is not cryptographically secure. An attacker can craft data that produces the same CRC. MD5 and SHA are cryptographic hash functions designed to be collision-resistant for security use cases. For embedded error detection, use CRC. For authentication or password hashing, use SHA-256 or better.
- Can I calculate CRC for hexadecimal byte sequences?
- Yes — switch the input mode to HEX and enter space-separated hex byte pairs (e.g. 01 FF A3 B2). This is the correct mode for protocol frames, register maps, or binary data where you know the byte values. The text mode uses UTF-8 encoding; hex mode treats each pair directly as a raw binary byte value.
- What CRC values should I get for the test string 123456789?
- 123456789 (ASCII) is the standard check string for CRC catalogues. Correct results are: CRC-8 = 0xF4, CRC-16/MODBUS = 0x4B37, CRC-16/CCITT (init 0xFFFF) = 0x29B1, CRC-32 = 0xCBF43926 and CRC-32C = 0xE3069283. If your own code returns something else, its polynomial, init value, reflection or final XOR is wrong.
- Why doesn't my CRC-16 match the one from my device?
- Several different algorithms are all called CRC-16. The same input 123456789 gives 0x4B37 for MODBUS but 0x29B1 for CCITT, because init value and bit reflection differ. Pick the variant your device documents, and remember Modbus RTU sends the CRC low byte first, so 0x4B37 appears on the wire as 37 4B.
From the blog
Related tools
- IEEE 754 Converter
Convert decimal numbers to IEEE 754 single- and double-precision floating point representation, and decode them back. Free, no sign-up.
- ASCII Table
Complete ASCII character table with decimal, hex, octal, and binary values for every printable and control character. Free, no sign-up.
- Baud Rate Calculator
Calculate UART baud rate error for any clock or crystal frequency — divisor settings, actual vs target baud, and the acceptable error threshold.
- Battery Life Calculator — mAh to Hours Runtime Estimator
Estimate battery life for Arduino, ESP32, and other IoT devices based on capacity, current draw, and sleep cycles. Free, instant.
- PWM Servo Calculator
Calculate PWM pulse width, duty cycle, and the resulting servo angle for hobby servos and microcontroller projects. Free, instant.