Skip to main content
CRC Calc

CRC-8 / NRSC-5

Width8-bitRefInNoRefOutNo

Need custom parameters? Open in full calculator

Standard test string

Result

0xF7

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

0x000x310x620x530xC40xF50xA60x970xB90x880xDB0xEA0x7D0x4C0x1F0x2E
0x430x720x210x100x870xB60xE50xD40xFA0xCB0x980xA90x3E0x0F0x5C0x6D
0x860xB70xE40xD50x420x730x200x110x3F0x0E0x5D0x6C0xFB0xCA0x990xA8
0xC50xF40xA70x960x010x300x630x520x7C0x4D0x1E0x2F0xB80x890xDA0xEB
0x3D0x0C0x5F0x6E0xF90xC80x9B0xAA0x840xB50xE60xD70x400x710x220x13
0x7E0x4F0x1C0x2D0xBA0x8B0xD80xE90xC70xF60xA50x940x030x320x610x50
0xBB0x8A0xD90xE80x7F0x4E0x1D0x2C0x020x330x600x510xC60xF70xA40x95
0xF80xC90x9A0xAB0x3C0x0D0x5E0x6F0x410x700x230x120x850xB40xE70xD6
0x7A0x4B0x180x290xBE0x8F0xDC0xED0xC30xF20xA10x900x070x360x650x54
0x390x080x5B0x6A0xFD0xCC0x9F0xAE0x800xB10xE20xD30x440x750x260x17
0xFC0xCD0x9E0xAF0x380x090x5A0x6B0x450x740x270x160x810xB00xE30xD2
0xBF0x8E0xDD0xEC0x7B0x4A0x190x280x060x370x640x550xC20xF30xA00x91
0x470x760x250x140x830xB20xE10xD00xFE0xCF0x9C0xAD0x3A0x0B0x580x69
0x040x350x660x570xC00xF10xA20x930xBD0x8C0xDF0xEE0x790x480x1B0x2A
0xC10xF00xA30x920x050x340x670x560x780x490x1A0x2B0xBC0x8D0xDE0xEF
0x820xB30xE00xD10x460x770x240x150x3B0x0A0x590x680xFF0xCE0x9D0xAC

CRC Source Code

/* 
 * Model: CRC-8 / NRSC-5 (8-bit)
 * Poly: 0x31, Init: 0xFF, XorOut: 0x00
 * CRC Table C Source Code & Lookup Table Generator
 */
#include <stdint.h>
#include <stddef.h>

const uint8_t crc_table[256] = {
  0x00, 0x31, 0x62, 0x53, 0xC4, 0xF5, 0xA6, 0x97, 
  0xB9, 0x88, 0xDB, 0xEA, 0x7D, 0x4C, 0x1F, 0x2E, 
  0x43, 0x72, 0x21, 0x10, 0x87, 0xB6, 0xE5, 0xD4, 
  0xFA, 0xCB, 0x98, 0xA9, 0x3E, 0x0F, 0x5C, 0x6D, 
  0x86, 0xB7, 0xE4, 0xD5, 0x42, 0x73, 0x20, 0x11, 
  0x3F, 0x0E, 0x5D, 0x6C, 0xFB, 0xCA, 0x99, 0xA8, 
  0xC5, 0xF4, 0xA7, 0x96, 0x01, 0x30, 0x63, 0x52, 
  0x7C, 0x4D, 0x1E, 0x2F, 0xB8, 0x89, 0xDA, 0xEB, 
  0x3D, 0x0C, 0x5F, 0x6E, 0xF9, 0xC8, 0x9B, 0xAA, 
  0x84, 0xB5, 0xE6, 0xD7, 0x40, 0x71, 0x22, 0x13, 
  0x7E, 0x4F, 0x1C, 0x2D, 0xBA, 0x8B, 0xD8, 0xE9, 
  0xC7, 0xF6, 0xA5, 0x94, 0x03, 0x32, 0x61, 0x50, 
  0xBB, 0x8A, 0xD9, 0xE8, 0x7F, 0x4E, 0x1D, 0x2C, 
  0x02, 0x33, 0x60, 0x51, 0xC6, 0xF7, 0xA4, 0x95, 
  0xF8, 0xC9, 0x9A, 0xAB, 0x3C, 0x0D, 0x5E, 0x6F, 
  0x41, 0x70, 0x23, 0x12, 0x85, 0xB4, 0xE7, 0xD6, 
  0x7A, 0x4B, 0x18, 0x29, 0xBE, 0x8F, 0xDC, 0xED, 
  0xC3, 0xF2, 0xA1, 0x90, 0x07, 0x36, 0x65, 0x54, 
  0x39, 0x08, 0x5B, 0x6A, 0xFD, 0xCC, 0x9F, 0xAE, 
  0x80, 0xB1, 0xE2, 0xD3, 0x44, 0x75, 0x26, 0x17, 
  0xFC, 0xCD, 0x9E, 0xAF, 0x38, 0x09, 0x5A, 0x6B, 
  0x45, 0x74, 0x27, 0x16, 0x81, 0xB0, 0xE3, 0xD2, 
  0xBF, 0x8E, 0xDD, 0xEC, 0x7B, 0x4A, 0x19, 0x28, 
  0x06, 0x37, 0x64, 0x55, 0xC2, 0xF3, 0xA0, 0x91, 
  0x47, 0x76, 0x25, 0x14, 0x83, 0xB2, 0xE1, 0xD0, 
  0xFE, 0xCF, 0x9C, 0xAD, 0x3A, 0x0B, 0x58, 0x69, 
  0x04, 0x35, 0x66, 0x57, 0xC0, 0xF1, 0xA2, 0x93, 
  0xBD, 0x8C, 0xDF, 0xEE, 0x79, 0x48, 0x1B, 0x2A, 
  0xC1, 0xF0, 0xA3, 0x92, 0x05, 0x34, 0x67, 0x56, 
  0x78, 0x49, 0x1A, 0x2B, 0xBC, 0x8D, 0xDE, 0xEF, 
  0x82, 0xB3, 0xE0, 0xD1, 0x46, 0x77, 0x24, 0x15, 
  0x3B, 0x0A, 0x59, 0x68, 0xFF, 0xCE, 0x9D, 0xAC
};

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

About CRC-8/NRSC-5

CRC-8/NRSC-5 is an 8-bit CRC used by the NRSC-5 in-band on-channel digital radio standard.

CRC-8/NRSC-5 is a 8-bit CRC model defined by polynomial 0x31, an initial register value of 0xFF, and final XOR 0x00. It uses normal, non-reflected input and output processing.

Documented application context for this model includes NRSC-5, HD Radio, Digital broadcast. 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
0xF7

Model characteristics

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

Bit order
Normal
Register start
0xFF
Final XOR
0x00
Published check
0xF7

Implementation checks for CRC-8/NRSC-5

  • Use a 8-bit register and polynomial 0x31.
  • Initialize the register to 0xFF and use XorOut 0x00 exactly as listed; changing either value defines a different model.
  • Verify the implementation with ASCII “123456789”; the expected result is 0xF7.

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

Complete CRC-8/NRSC-5 parameters

CRC parameter guide
ParameterValueMeaningReference
Width8 bitsCRC register and result widthRead guide
Poly0x31Generator polynomial without the leading termRead guide
Init0xFFInitial CRC register valueRead guide
RefInNoReflect each input byte before processingRead guide
RefOutNoReflect the register before XOR OutRead guide
XorOut0x00Final value XORed with the CRC registerRead guide
Check0xF7CRC of ASCII “123456789”Read guide
ResidueNot listedExpected residue after appending a valid CRCRead guide
AliasesNRSC-5 CRC-8

Where CRC-8/NRSC-5 is used

  • 01NRSC-5
  • 02HD Radio
  • 03Digital broadcast

CRC-8/NRSC-5 FAQ

What is the check value for CRC-8/NRSC-5?

For the standard ASCII test input 123456789, the check value of CRC-8/NRSC-5 is 0xF7.

What polynomial does CRC-8/NRSC-5 use?

CRC-8/NRSC-5 uses the 8-bit polynomial 0x31.

Does CRC-8/NRSC-5 use reflected input and output?

For CRC-8/NRSC-5, RefIn is No and RefOut is No.

What is CRC-8/NRSC-5 commonly confused with?

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