CRC16 Checksum Generator

Generate 16-bit Cyclic Redundancy Check (CRC) checksums for error detection. Perfect for industrial protocols, data transmission, and storage verification. Multiple variants supported including CCITT, MODBUS, and IBM.

Enter any text to generate its 16-bit CRC checksum
Common in X.25, HDLC, XMODEM
CRC16 checksum will appear here...
Important: CRC16 is designed for error detection, not cryptographic security [citation:9]. It is easily reversible and should not be used for password hashing, digital signatures, or any security-critical applications. For security purposes, use SHA-256 or SHA-512 instead.

Understanding CRC16 (Cyclic Redundancy Check)

CRC16 is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data [citation:2]. It works by treating the input data as a polynomial and performing polynomial division, producing a 16-bit remainder that serves as the checksum.

How CRC16 Works

The CRC16 algorithm performs polynomial division over the input data using a predetermined generator polynomial [citation:5]. The process involves:

  • Initializing a 16-bit register with a start value
  • Processing each byte through XOR operations and bit shifts
  • Applying the polynomial when the most significant bit is set
  • Optionally reflecting input/output bits and applying final XOR

Common CRC16 Variants [citation:2][citation:3][citation:5]

VariantPolynomialInitial ValueCommon Use
CRC-16/CCITT0x10210xFFFFX.25, HDLC, XMODEM
CRC-16/MODBUS0x80050xFFFFModbus protocol
CRC-16/IBM0x80050x0000ARC, LHA
CRC-16/XMODEM0x10210x0000XMODEM protocol
CRC-16/USB0x80050xFFFFUSB packets

Common Use Cases [citation:2][citation:10]

  • Industrial Protocols: Modbus communication for PLCs and industrial automation
  • USB: Error detection in USB packet transmission
  • Telecommunications: X.25, HDLC, and other telecom protocols
  • Storage Systems: Verifying data integrity in storage devices
  • Embedded Systems: Serial communication and sensor data verification
Note on Variants: Different CRC16 variants are not interchangeable. When implementing CRC16 in a system, ensure both ends use the exact same variant (polynomial, initial value, reflection settings) [citation:3].

Key Features

  • 16-bit output (0-65535)
  • 8 popular variants
  • Text & Binary file support
  • Modbus compatible
  • Extremely fast computation

CRC16 Specifications

Output Size16 bits (2 bytes)
Hex Length4 characters
Decimal Range0 to 65535
Polynomial Length17 bits
Detection CapabilityAll single-bit, double-bit, odd-bit errors
Common Polynomials0x1021, 0x8005, 0x3D65
Primary UseError detection
Security SuitabilityNot for security

Modbus Protocol Example [citation:3]

Modbus RTU Frame Structure

Modbus RTU uses CRC16 for error checking. A typical Modbus frame includes:

  • Address: 1 byte (device address)
  • Function Code: 1 byte (read/write command)
  • Data: n bytes (register address, value, etc.)
  • CRC16: 2 bytes (checksum of all preceding bytes)

Example Calculation

Request: 01 06 00 01 03 00 (set register 1 to value 0x0300)
CRC16/MODBUS: D8 FA (calculated with polynomial 0x8005, initial 0xFFFF, bit reflection)

Note: Modbus sends CRC bytes in little-endian order (least significant byte first)

CRC16 Hash Examples (by variant)

InputCRC-16/CCITTCRC-16/MODBUSCRC-16/XMODEM
Hello, World!FA4D56C25A23
The quick brown fox jumps over the lazy dog92F83F0A1B8C
123456789031C3C3B3A2B1

Note: Different variants produce different results for the same input

JavaScript Implementation [citation:2][citation:5]

CRC-16/CCITT Implementation

function crc16CCITT(data) {
  let crc = 0xFFFF;
  const polynomial = 0x1021;
  
  for (let i = 0; i < data.length; i++) {
    crc ^= data.charCodeAt(i) << 8;
    for (let j = 0; j < 8; j++) {
      if (crc & 0x8000) {
        crc = (crc << 1) ^ polynomial;
      } else {
        crc <<= 1;
      }
      crc &= 0xFFFF;
    }
  }
  
  return crc.toString(16).toUpperCase();
}

CRC-16/MODBUS Implementation

function crc16Modbus(data) {
  let crc = 0xFFFF;
  const polynomial = 0x8005;
  
  for (let i = 0; i < data.length; i++) {
    crc ^= data.charCodeAt(i);
    for (let j = 0; j < 8; j++) {
      if (crc & 0x0001) {
        crc = (crc >> 1) ^ polynomial;
      } else {
        crc >>= 1;
      }
    }
  }
  
  return crc.toString(16).toUpperCase();
}

Frequently Asked Questions About CRC16

CRC (Cyclic Redundancy Check) is a type of checksum that uses polynomial division, offering better error detection than simple additive checksums. While simple checksums (like sum of bytes) can miss certain errors, CRC16 can detect all single-bit errors, double-bit errors, and most burst errors up to 16 bits [citation:2].

Different industries and protocols developed their own CRC standards over time [citation:3]. The choice of polynomial, initial value, and bit reflection affects the error detection properties. For example, the Modbus protocol needed specific properties for industrial communication, while USB required different characteristics. Using the wrong variant will produce incorrect checksums.

The variant is usually determined by the protocol or system you're working with [citation:3][citation:10]:
  • Modbus devices: Use CRC-16/MODBUS
  • USB: Use CRC-16/USB
  • XMODEM file transfer: Use CRC-16/XMODEM
  • Telecom (X.25, HDLC): Use CRC-16/CCITT
  • ARC/LHA archives: Use CRC-16/IBM
Check your protocol documentation for the exact specification.

No, CRC16 cannot detect all errors, but it's very effective. It detects [citation:2]:
  • 100% of all single-bit errors
  • 100% of all double-bit errors
  • 100% of all odd-numbered bit errors
  • 100% of burst errors up to 16 bits
  • 99.998% of longer burst errors
For applications requiring guaranteed error detection, consider using error-correcting codes or multiple CRCs.

The main difference is the checksum size: 16 bits vs 32 bits. CRC32 provides stronger error detection (can detect longer burst errors) but requires more computation. CRC16 is often preferred in embedded systems and real-time applications where speed and simplicity are critical, and the data sizes are smaller [citation:2][citation:10].

All CRC16 calculations are performed client-side in your browser. Your data never leaves your device. No information is stored or transmitted to any server.

Note: CRC16 is for error detection only, not cryptographic security. For secure hashing, use SHA-256 or SHA-512.