Skip to main content
CRC Calc

CRC-16 / USB

Width16-bitRefInYesRefOutYes

Need custom parameters? Open in full calculator

Standard test string

Result

0xB4C8

Similar CRC Algorithms

Result is calculated from the current input. Check is the published verification value for the standard input 123456789. Click another algorithm to view its detail page.

CRC Lookup Table

0x00000xC0C10xC1810x01400xC3010x03C00x02800xC2410xC6010x06C00x07800xC7410x05000xC5C10xC4810x0440
0xCC010x0CC00x0D800xCD410x0F000xCFC10xCE810x0E400x0A000xCAC10xCB810x0B400xC9010x09C00x08800xC841
0xD8010x18C00x19800xD9410x1B000xDBC10xDA810x1A400x1E000xDEC10xDF810x1F400xDD010x1DC00x1C800xDC41
0x14000xD4C10xD5810x15400xD7010x17C00x16800xD6410xD2010x12C00x13800xD3410x11000xD1C10xD0810x1040
0xF0010x30C00x31800xF1410x33000xF3C10xF2810x32400x36000xF6C10xF7810x37400xF5010x35C00x34800xF441
0x3C000xFCC10xFD810x3D400xFF010x3FC00x3E800xFE410xFA010x3AC00x3B800xFB410x39000xF9C10xF8810x3840
0x28000xE8C10xE9810x29400xEB010x2BC00x2A800xEA410xEE010x2EC00x2F800xEF410x2D000xEDC10xEC810x2C40
0xE4010x24C00x25800xE5410x27000xE7C10xE6810x26400x22000xE2C10xE3810x23400xE1010x21C00x20800xE041
0xA0010x60C00x61800xA1410x63000xA3C10xA2810x62400x66000xA6C10xA7810x67400xA5010x65C00x64800xA441
0x6C000xACC10xAD810x6D400xAF010x6FC00x6E800xAE410xAA010x6AC00x6B800xAB410x69000xA9C10xA8810x6840
0x78000xB8C10xB9810x79400xBB010x7BC00x7A800xBA410xBE010x7EC00x7F800xBF410x7D000xBDC10xBC810x7C40
0xB4010x74C00x75800xB5410x77000xB7C10xB6810x76400x72000xB2C10xB3810x73400xB1010x71C00x70800xB041
0x50000x90C10x91810x51400x93010x53C00x52800x92410x96010x56C00x57800x97410x55000x95C10x94810x5440
0x9C010x5CC00x5D800x9D410x5F000x9FC10x9E810x5E400x5A000x9AC10x9B810x5B400x99010x59C00x58800x9841
0x88010x48C00x49800x89410x4B000x8BC10x8A810x4A400x4E000x8EC10x8F810x4F400x8D010x4DC00x4C800x8C41
0x44000x84C10x85810x45400x87010x47C00x46800x86410x82010x42C00x43800x83410x41000x81C10x80810x4040

CRC Source Code

/* 
 * Model: CRC-16 / USB (16-bit)
 * Poly: 0x8005, Init: 0xFFFF, XorOut: 0xFFFF
 * CRC Table C Source Code & Lookup Table Generator
 */
#include <stdint.h>
#include <stddef.h>

const uint16_t crc_table[256] = {
  0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 
  0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 
  0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 
  0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 
  0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 
  0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 
  0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 
  0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 
  0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 
  0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 
  0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 
  0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 
  0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 
  0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 
  0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 
  0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 
  0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 
  0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 
  0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 
  0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 
  0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 
  0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 
  0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 
  0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 
  0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 
  0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 
  0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 
  0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 
  0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 
  0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 
  0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 
  0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
};

uint16_t calculate_crc(const uint8_t *data, size_t length) {
    uint16_t crc = 0xFFFF;
    for (size_t i = 0; i < length; i++) {
        #if 1
        uint8_t idx = (uint8_t)(crc ^ data[i]);
        crc = (crc >> 8) ^ crc_table[idx];
        #else
        uint8_t idx = (uint8_t)((crc >> 8) ^ data[i]);
        crc = (crc << 8) ^ crc_table[idx];
        #endif
    }
    return crc ^ 0xFFFF;
}

About CRC-16/USB

CRC-16/USB is the 16-bit CRC variant used for USB data packets.

CRC-16/USB is a 16-bit CRC model defined by polynomial 0x8005, an initial register value of 0xFFFF, and final XOR 0xFFFF. It processes reflected input bytes and reports a reflected output.

Documented application context for this model includes USB packets, Hardware validation, Protocol analyzers. The calculator above applies this exact parameter set to the current input; the published Check value below is instead the fixed verification result for ASCII 123456789.

Standard test vector

CRC implementations are commonly verified with the ASCII input 123456789.

Input format
ASCII
Input
123456789
Expected CRC
0xB4C8
Residue
0xB001

Model characteristics

A model is identified by its complete parameter set, not its polynomial alone.

Bit order
Reflected
Register start
0xFFFF
Final XOR
0xFFFF
Published check
0xB4C8

Implementation checks for CRC-16/USB

  • Use a 16-bit register and polynomial 0x8005.
  • Initialize the register to 0xFFFF and use XorOut 0xFFFF exactly as listed; changing either value defines a different model.
  • Verify the implementation with ASCII “123456789”; the expected result is 0xB4C8.

Continue with the main calculator, browse the algorithm catalog, compare models in the Algorithm Reference section, or generate a lookup table.

Complete CRC-16/USB parameters

CRC parameter guide
ParameterValueMeaningReference
Width16 bitsCRC register and result widthRead guide
Poly0x8005Generator polynomial without the leading termRead guide
Init0xFFFFInitial CRC register valueRead guide
RefInYesReflect each input byte before processingRead guide
RefOutYesReflect the register before XOR OutRead guide
XorOut0xFFFFFinal value XORed with the CRC registerRead guide
Check0xB4C8CRC of ASCII “123456789”Read guide
Residue0xB001Expected residue after appending a valid CRCRead guide
AliasesUSB CRC16

Where CRC-16/USB is used

  • 01USB packets
  • 02Hardware validation
  • 03Protocol analyzers

CRC-16/USB FAQ

What is the check value for CRC-16/USB?

For the standard ASCII test input 123456789, the check value of CRC-16/USB is 0xB4C8.

What polynomial does CRC-16/USB use?

CRC-16/USB uses the 16-bit polynomial 0x8005.

Does CRC-16/USB use reflected input and output?

For CRC-16/USB, RefIn is Yes and RefOut is Yes.

What is CRC-16/USB commonly confused with?

CRC-16/MAXIM-DOW uses the same polynomial (0x8005), which is the usual source of mix-ups — matching the polynomial alone does not reproduce CRC-16/USB. The two models differ in initial value, so a port from one to the other needs those fields checked explicitly, not just the poly.