Embedded Calculators & Part Finder
Size a value with 64 free calculators, then find the real component that fits — in stock, at the best price. For MCU, power, RF & firmware. No account.
Checksum & CRC Calculator
Calculate XOR, Sum8/16, Two's complement, LRC, and CRC-8/16/32 from ASCII text or Hex bytes.
Checksums are simple mathematical algorithms used to verify the integrity of transmitted data packets.
Algorithms:
- XOR (BCC):
Byte_1 ^ Byte_2 ^ ... ^ Byte_N - Sum 8-bit:
Sum(Bytes) % 256 - Two's Complement Sum:
256 - (Sum(Bytes) % 256)
Usage: Enter ASCII text or Hex bytes. The tool calculates XOR, Sum8, Sum16, Two's complement, LRC, and basic CRCs simultaneously to assist in protocol decoding.
When you need it: Verifying a firmware image or packet payload with a simple additive, two's-complement or XOR checksum before trusting it — the lightweight integrity check on countless serial protocols and hex files.
Worked example: An 8-bit two's-complement checksum of {0x10, 0x20, 0x30}: sum = 0x60, checksum = (−0x60) & 0xFF = 0xA0, so (sum + checksum) & 0xFF = 0x00. Intel HEX records use exactly this scheme.
Tips & gotchas:
- Additive and XOR checksums catch single-byte errors but miss byte reordering and many multi-bit errors — use a CRC when you need real coverage.
- Define whether the checksum byte is itself included in the sum; both conventions exist.
- For 16/32-bit sums, pin down endianness and any carry/one's-complement folding (as in the IP/UDP checksum).
- Specify the initial value and any final XOR so both ends compute the same result.