Index / Developer
CRC Calculator
104 named variants and any parameters you like, computed a bit at a time from the definition rather than from a table. The usual problem is not computing a CRC but working out which of the six things called CRC-16 a device meant, so paste the value it gave you and this page names every variant that produces it.
Message
The default is the string every CRC catalogue
uses as its check value.
In hex mode spaces, commas, colons and 0x are
ignored.
Optional, hex. Every variant that produces it is
listed at the bottom.
CRC-32/ISO-HDLC
CBF43926
Message bytes
9
Width
32
Parameters
Editing any box below switches this to Custom. The
six boxes are the whole definition of a CRC; the name is only a
label for them.
Normal form: the top bit is implied and not
written.
The result, in the forms a frame wants
not grouped — these are for pastingWhat this page's own arithmetic says
Which variant produced the CRC you were given
nothing to matchThe same message, under every variant
What the six parameters mean, and what this page does with them
A CRC is six numbers, not a name. Width, polynomial, init, reflect
in, reflect out and final XOR — the model Ross Williams wrote down
in 1993 and every catalogue has used since. Two devices can both say
“CRC-16” and share none of the six. That is why the names
here are written the way the CRC RevEng catalogue writes them, with the
standard that defines each one after the slash.
The polynomial is in normal form, with the top bit implied. A 32-bit CRC's polynomial has 33 bits; the highest is always set, so it is not written. The same polynomial reversed is what a reflected implementation shifts right by, and it is a different hex number — 0x04C11DB7 and 0xEDB88320 are one polynomial, not two.
Reflection is about bit order, and it is where most mismatches come from. Reflect-in reverses the eight bits of every message byte on the way in; reflect-out reverses the whole register at the end. Hardware that shifts a byte in least-significant-bit first is doing the first one for free, which is why so many real variants have both set.
The check value is the CRC of the nine ASCII bytes
It is computed a bit at a time, from the definition. No lookup table is built. A table is an optimisation, and an optimisation is a second place for a mistake to live; at these message sizes it would save nothing anybody could perceive.
Byte order is not part of the CRC. The value is a number; how it is laid into a frame is the protocol's business, and protocols disagree. Modbus appends the low byte first, which is why a Modbus CRC so often looks byte-swapped against a calculator. Both orders are printed and neither is more correct.
The message is capped at 4,096 bytes. Every variant is recomputed on every keystroke, so the cap is what keeps the page instant on a phone; past it the input is truncated and this says so. Nothing is padded and nothing is augmented — the register form used here needs no trailing zero bytes.
Widths above 32 are refused. Above that the register stops fitting in the 32-bit integers JavaScript's bitwise operators work on, and the arithmetic would quietly become floating point. A limit stated is a feature; CRC-64 needs a different implementation, not a wider box.
The link carries the settings, and the message only when it is short. Over 256 characters it is left out rather than pushed into your browser history, and the page says so when that happens.
The polynomial is in normal form, with the top bit implied. A 32-bit CRC's polynomial has 33 bits; the highest is always set, so it is not written. The same polynomial reversed is what a reflected implementation shifts right by, and it is a different hex number — 0x04C11DB7 and 0xEDB88320 are one polynomial, not two.
Reflection is about bit order, and it is where most mismatches come from. Reflect-in reverses the eight bits of every message byte on the way in; reflect-out reverses the whole register at the end. Hardware that shifts a byte in least-significant-bit first is doing the first one for free, which is why so many real variants have both set.
The check value is the CRC of the nine ASCII bytes
123456789, and every catalogue publishes it for exactly
one reason: an implementation that gets it right is almost certainly
right. This page prints its own check value next to the published one on
every render, so the arithmetic is asserted in front of you rather than
claimed. All 104 variants here agree with their published value.
It is computed a bit at a time, from the definition. No lookup table is built. A table is an optimisation, and an optimisation is a second place for a mistake to live; at these message sizes it would save nothing anybody could perceive.
Byte order is not part of the CRC. The value is a number; how it is laid into a frame is the protocol's business, and protocols disagree. Modbus appends the low byte first, which is why a Modbus CRC so often looks byte-swapped against a calculator. Both orders are printed and neither is more correct.
The message is capped at 4,096 bytes. Every variant is recomputed on every keystroke, so the cap is what keeps the page instant on a phone; past it the input is truncated and this says so. Nothing is padded and nothing is augmented — the register form used here needs no trailing zero bytes.
Widths above 32 are refused. Above that the register stops fitting in the 32-bit integers JavaScript's bitwise operators work on, and the arithmetic would quietly become floating point. A limit stated is a feature; CRC-64 needs a different implementation, not a wider box.
The link carries the settings, and the message only when it is short. Over 256 characters it is left out rather than pushed into your browser history, and the page says so when that happens.