User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
UTF-8 encoded. Max recommended: 10 MB of text.
Drop a file here or click to browse
0%
CRC-16 Hash
Hexadecimal (uppercase)
Hexadecimal (lowercase)
Decimal
Binary
History
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

CRC-16 (Cyclic Redundancy Check, 16-bit) is a family of error-detecting codes used in digital networks, storage devices, and industrial protocols (MODBUS, DNP3, USB). The generator polynomial G(x) of degree 16 divides the input message polynomial over GF(2), producing a 16-bit remainder. Incorrect polynomial selection or init-value mismatch silently passes corrupted frames in SCADA and PLC communications. This tool computes CRC-16 using precomputed 256-entry lookup tables for each variant, matching bit-reflection and XOR-out parameters defined by the catalogue maintained by Greg Cook. It approximates no values; every variant reproduces reference test vectors for the ASCII string "123456789".

Note: CRC-16 detects all single-bit, double-bit, and odd-count bit errors within its Hamming distance, but it is not a cryptographic hash. Do not use it for authentication or tamper detection. For files, processing is offloaded to a background thread to avoid UI blocking.

crc-16 hash generator checksum calculator crc16 modbus crc-16 ccitt cyclic redundancy check data integrity

Formulas

CRC-16 treats the input byte sequence as a polynomial M(x) over GF(2) and computes the remainder after division by a generator polynomial G(x) of degree 16.

CRC = (M(x) โ‹… x16) mod G(x) โŠ• XorOut

For table-driven computation, a 256-entry lookup table T is precomputed. For each byte b in the message, the register R is updated:

R โ† (R 8) โŠ• T[(R 8) โŠ• b]

When RefIn is TRUE, each input byte is bit-reversed before processing. When RefOut is TRUE, the final register is bit-reversed before XOR. The reflected variant uses a mirrored polynomial and processes from the low byte:

R โ† (R 8) โŠ• T[(R โŠ• b) โˆง 0xFF]

Where M(x) = message polynomial, G(x) = generator polynomial, R = CRC register (initialized to Init), T = lookup table, b = current byte, โŠ• = bitwise XOR, XorOut = final XOR mask.

Reference Data

VariantPolynomialInitRefInRefOutXorOutCheck ("123456789")Common Use
CRC-16/ARC0x80050x0000truetrue0x00000xBB3DARC, LHA
CRC-16/CCITT-FALSE0x10210xFFFFfalsefalse0x00000x29B1Bluetooth, PPP
CRC-16/XMODEM0x10210x0000falsefalse0x00000x31C3XMODEM, ZMODEM
CRC-16/MODBUS0x80050xFFFFtruetrue0x00000x4B37MODBUS RTU
CRC-16/USB0x80050xFFFFtruetrue0xFFFF0xB4C8USB Token/Data
CRC-16/BUYPASS0x80050x0000falsefalse0x00000xFEE8Verifone, Buypass
CRC-16/CDMA20000xC8670xFFFFfalsefalse0x00000x4C06CDMA2000 3GPP2
CRC-16/DNP0x3D650x0000truetrue0xFFFF0xEA82DNP3 SCADA
CRC-16/MAXIM0x80050x0000truetrue0xFFFF0x44C21-Wire Maxim
CRC-16/KERMIT0x10210x0000truetrue0x00000x2189Kermit Protocol
CRC-16/AUG-CCITT0x10210x1D0Ffalsefalse0x00000xE5CCSPI, IยฒC
CRC-16/GENIBUS0x10210xFFFFfalsefalse0xFFFF0xD64EEPC Gen 2 RFID

Frequently Asked Questions

Each CRC-16 variant is parameterized by five values: the generator polynomial, initial register value, input reflection flag, output reflection flag, and final XOR mask. Even variants sharing the same polynomial (e.g., CRC-16/ARC and CRC-16/MODBUS both use 0x8005) differ in their init value (0x0000 vs 0xFFFF), producing entirely different remainders. Always verify which variant your protocol specification requires.
Reflection reverses the bit order within each byte (RefIn) or the final 16-bit register (RefOut). Protocols like MODBUS RTU transmit LSB first, so they use reflected CRC. Protocols like XMODEM transmit MSB first and use non-reflected CRC. Using the wrong reflection setting causes valid frames to fail verification at the receiver, even though the polynomial is correct.
CRC-16 guarantees detection of all single-bit errors, all double-bit errors (for messages shorter than the polynomial period), all odd-count bit errors, and any burst error of length โ‰ค 16 bits. It does not detect all errors in bursts longer than 16 bits; the probability of missing such an error is approximately 1/65535 โ‰ˆ 0.0015%. For cryptographic integrity, use SHA-256 or similar.
Use CRC-16/MODBUS: polynomial 0x8005, init 0xFFFF, RefIn = TRUE, RefOut = TRUE, XorOut = 0x0000. The check value for the ASCII string "123456789" must equal 0x4B37. Verify against this test vector before deploying to production PLCs.
Yes. CRC operates on raw bytes, not characters. The string "cafรฉ" encoded in UTF-8 produces 5 bytes (the "รฉ" maps to 0xC3 0xA9), while ISO-8859-1 produces 4 bytes (0xE9). This tool uses UTF-8 encoding via the TextEncoder API. If your protocol uses a different encoding, hash the file directly as binary to avoid mismatches.
The lookup table approach precomputes all 256 possible byte-XOR results, reducing the inner loop from 8 conditional branches per byte to a single table lookup, shift, and XOR. This yields roughly 8ร— throughput improvement. For a 10 MB file, bitwise CRC-16 may take ~200 ms while table-driven completes in ~25 ms on modern hardware. This tool uses the table-driven method exclusively.