Checksum Calculator

Compute common lightweight checksums for frames and payloads: XOR, SUM, and LRC. Input can be HEX bytes or text (UTF-8). Everything runs locally in your browser.

Input

Result

Checksum (hex)
Checksum (dec)
Bytes (BE)
Bytes (LE)
Notes:
  • XOR: XOR of all bytes.
  • SUM: Sum of all bytes, then masked to N bits.
  • LRC: Two's complement of SUM(8-bit): LRC = (-SUM) & 0xFF.

Checksum examples

Use these short examples to verify an XOR checksum calculator, SUM checksum calculator, or LRC checksum calculator for a serial packet checksum.

Example HEX bytes: 01 02 03 04

XOR checksum example

XOR combines each byte with bitwise exclusive-or. For 01 02 03 04, the XOR checksum is 0x04.

01 XOR 02 XOR 03 XOR 04 = 04

SUM checksum example

SUM adds all bytes and masks the result to the selected width. With 8-bit SUM, 01 02 03 04 produces 0x0A.

01 + 02 + 03 + 04 = 0A

LRC checksum example

LRC uses the 8-bit two's complement of the SUM value. When the SUM is 0x0A, the LRC is 0xF6.

LRC = (-0x0A) & 0xFF = 0xF6

Checksum vs CRC

A checksum is a lightweight arithmetic integrity check. CRC uses polynomial division and is usually stronger for detecting transmission errors, so the right choice depends on the protocol.

FAQ

What is a checksum calculator?

A checksum calculator takes bytes or text and returns a small value that can be used to check whether a frame, packet, or payload changed.

What is the difference between XOR, SUM, and LRC checksums?

XOR combines bytes with bitwise exclusive-or, SUM adds bytes and masks the result to a fixed width, and LRC stores the two's complement of an 8-bit sum.

Is checksum the same as CRC?

No. A checksum is usually a simpler arithmetic check, while a CRC uses polynomial division and usually detects more transmission errors.

Related tools

Modbus RTU Frame Decoder · Modbus Function Codes · Modbus RTU Timing · CRC Calculator · HEX ⇄ ASCII ⇄ Binary · UART Packet Time