Skip to main content
CRC Calc

CRC-16 / DNP

Width16-bitRefInYesRefOutYes

Need custom parameters? Open in full calculator

Standard test string

Result

0xEA82

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

0x00000x365E0x6CBC0x5AE20xD9780xEF260xB5C40x839A0xFF890xC9D70x93350xA56B0x26F10x10AF0x4A4D0x7C13
0xB26B0x84350xDED70xE8890x6B130x5D4D0x07AF0x31F10x4DE20x7BBC0x215E0x17000x949A0xA2C40xF8260xCE78
0x29AF0x1FF10x45130x734D0xF0D70xC6890x9C6B0xAA350xD6260xE0780xBA9A0x8CC40x0F5E0x39000x63E20x55BC
0x9BC40xAD9A0xF7780xC1260x42BC0x74E20x2E000x185E0x644D0x52130x08F10x3EAF0xBD350x8B6B0xD1890xE7D7
0x535E0x65000x3FE20x09BC0x8A260xBC780xE69A0xD0C40xACD70x9A890xC06B0xF6350x75AF0x43F10x19130x2F4D
0xE1350xD76B0x8D890xBBD70x384D0x0E130x54F10x62AF0x1EBC0x28E20x72000x445E0xC7C40xF19A0xAB780x9D26
0x7AF10x4CAF0x164D0x20130xA3890x95D70xCF350xF96B0x85780xB3260xE9C40xDF9A0x5C000x6A5E0x30BC0x06E2
0xC89A0xFEC40xA4260x92780x11E20x27BC0x7D5E0x4B000x37130x014D0x5BAF0x6DF10xEE6B0xD8350x82D70xB489
0xA6BC0x90E20xCA000xFC5E0x7FC40x499A0x13780x25260x59350x6F6B0x35890x03D70x804D0xB6130xECF10xDAAF
0x14D70x22890x786B0x4E350xCDAF0xFBF10xA1130x974D0xEB5E0xDD000x87E20xB1BC0x32260x04780x5E9A0x68C4
0x8F130xB94D0xE3AF0xD5F10x566B0x60350x3AD70x0C890x709A0x46C40x1C260x2A780xA9E20x9FBC0xC55E0xF300
0x3D780x0B260x51C40x679A0xE4000xD25E0x88BC0xBEE20xC2F10xF4AF0xAE4D0x98130x1B890x2DD70x77350x416B
0xF5E20xC3BC0x995E0xAF000x2C9A0x1AC40x40260x76780x0A6B0x3C350x66D70x50890xD3130xE54D0xBFAF0x89F1
0x47890x71D70x2B350x1D6B0x9EF10xA8AF0xF24D0xC4130xB8000x8E5E0xD4BC0xE2E20x61780x57260x0DC40x3B9A
0xDC4D0xEA130xB0F10x86AF0x05350x336B0x69890x5FD70x23C40x159A0x4F780x79260xFABC0xCCE20x96000xA05E
0x6E260x58780x029A0x34C40xB75E0x81000xDBE20xEDBC0x91AF0xA7F10xFD130xCB4D0x48D70x7E890x246B0x1235

CRC Source Code

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

const uint16_t crc_table[256] = {
  0x0000, 0x365E, 0x6CBC, 0x5AE2, 0xD978, 0xEF26, 0xB5C4, 0x839A, 
  0xFF89, 0xC9D7, 0x9335, 0xA56B, 0x26F1, 0x10AF, 0x4A4D, 0x7C13, 
  0xB26B, 0x8435, 0xDED7, 0xE889, 0x6B13, 0x5D4D, 0x07AF, 0x31F1, 
  0x4DE2, 0x7BBC, 0x215E, 0x1700, 0x949A, 0xA2C4, 0xF826, 0xCE78, 
  0x29AF, 0x1FF1, 0x4513, 0x734D, 0xF0D7, 0xC689, 0x9C6B, 0xAA35, 
  0xD626, 0xE078, 0xBA9A, 0x8CC4, 0x0F5E, 0x3900, 0x63E2, 0x55BC, 
  0x9BC4, 0xAD9A, 0xF778, 0xC126, 0x42BC, 0x74E2, 0x2E00, 0x185E, 
  0x644D, 0x5213, 0x08F1, 0x3EAF, 0xBD35, 0x8B6B, 0xD189, 0xE7D7, 
  0x535E, 0x6500, 0x3FE2, 0x09BC, 0x8A26, 0xBC78, 0xE69A, 0xD0C4, 
  0xACD7, 0x9A89, 0xC06B, 0xF635, 0x75AF, 0x43F1, 0x1913, 0x2F4D, 
  0xE135, 0xD76B, 0x8D89, 0xBBD7, 0x384D, 0x0E13, 0x54F1, 0x62AF, 
  0x1EBC, 0x28E2, 0x7200, 0x445E, 0xC7C4, 0xF19A, 0xAB78, 0x9D26, 
  0x7AF1, 0x4CAF, 0x164D, 0x2013, 0xA389, 0x95D7, 0xCF35, 0xF96B, 
  0x8578, 0xB326, 0xE9C4, 0xDF9A, 0x5C00, 0x6A5E, 0x30BC, 0x06E2, 
  0xC89A, 0xFEC4, 0xA426, 0x9278, 0x11E2, 0x27BC, 0x7D5E, 0x4B00, 
  0x3713, 0x014D, 0x5BAF, 0x6DF1, 0xEE6B, 0xD835, 0x82D7, 0xB489, 
  0xA6BC, 0x90E2, 0xCA00, 0xFC5E, 0x7FC4, 0x499A, 0x1378, 0x2526, 
  0x5935, 0x6F6B, 0x3589, 0x03D7, 0x804D, 0xB613, 0xECF1, 0xDAAF, 
  0x14D7, 0x2289, 0x786B, 0x4E35, 0xCDAF, 0xFBF1, 0xA113, 0x974D, 
  0xEB5E, 0xDD00, 0x87E2, 0xB1BC, 0x3226, 0x0478, 0x5E9A, 0x68C4, 
  0x8F13, 0xB94D, 0xE3AF, 0xD5F1, 0x566B, 0x6035, 0x3AD7, 0x0C89, 
  0x709A, 0x46C4, 0x1C26, 0x2A78, 0xA9E2, 0x9FBC, 0xC55E, 0xF300, 
  0x3D78, 0x0B26, 0x51C4, 0x679A, 0xE400, 0xD25E, 0x88BC, 0xBEE2, 
  0xC2F1, 0xF4AF, 0xAE4D, 0x9813, 0x1B89, 0x2DD7, 0x7735, 0x416B, 
  0xF5E2, 0xC3BC, 0x995E, 0xAF00, 0x2C9A, 0x1AC4, 0x4026, 0x7678, 
  0x0A6B, 0x3C35, 0x66D7, 0x5089, 0xD313, 0xE54D, 0xBFAF, 0x89F1, 
  0x4789, 0x71D7, 0x2B35, 0x1D6B, 0x9EF1, 0xA8AF, 0xF24D, 0xC413, 
  0xB800, 0x8E5E, 0xD4BC, 0xE2E2, 0x6178, 0x5726, 0x0DC4, 0x3B9A, 
  0xDC4D, 0xEA13, 0xB0F1, 0x86AF, 0x0535, 0x336B, 0x6989, 0x5FD7, 
  0x23C4, 0x159A, 0x4F78, 0x7926, 0xFABC, 0xCCE2, 0x9600, 0xA05E, 
  0x6E26, 0x5878, 0x029A, 0x34C4, 0xB75E, 0x8100, 0xDBE2, 0xEDBC, 
  0x91AF, 0xA7F1, 0xFD13, 0xCB4D, 0x48D7, 0x7E89, 0x246B, 0x1235
};

uint16_t calculate_crc(const uint8_t *data, size_t length) {
    uint16_t crc = 0x0000;
    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/DNP

CRC-16/DNP is used by Distributed Network Protocol and related utility communication systems.

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

Documented application context for this model includes DNP3, SCADA, Utility networks. 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
0xEA82
Residue
0x66C5

Model characteristics

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

Bit order
Reflected
Register start
0x0000
Final XOR
0xFFFF
Published check
0xEA82

Implementation checks for CRC-16/DNP

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

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

Complete CRC-16/DNP parameters

CRC parameter guide
ParameterValueMeaningReference
Width16 bitsCRC register and result widthRead guide
Poly0x3D65Generator polynomial without the leading termRead guide
Init0x0000Initial 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
Check0xEA82CRC of ASCII “123456789”Read guide
Residue0x66C5Expected residue after appending a valid CRCRead guide
AliasesDNP CRC-16

Where CRC-16/DNP is used

  • 01DNP3
  • 02SCADA
  • 03Utility networks

CRC-16/DNP FAQ

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

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

What polynomial does CRC-16/DNP use?

CRC-16/DNP uses the 16-bit polynomial 0x3D65.

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

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

What is CRC-16/DNP commonly confused with?

CRC-16/EN-13757 uses the same polynomial (0x3D65), which is the usual source of mix-ups — matching the polynomial alone does not reproduce CRC-16/DNP. The two models differ in input reflection and output reflection, so a port from one to the other needs those fields checked explicitly, not just the poly.