Skip to content
UniKit

LRC checksum

Compute the Modbus ASCII LRC: sum every byte, keep the low 8 bits and take the two's complement — (256 - sum % 256) % 256. A plain sum mode is available for manuals that only accumulate. Input may be UTF-8 text, hex, Base64 or decimal bytes, and the output is hex (optionally uppercase) or decimal. LRC detects errors; it is not encryption and offers no tamper resistance.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Content to check

Checksum

The complement mode is (256 - sum % 256) % 256, matching the Modbus ASCII specification.

Enter content to see the checksum

Checksum (decimal): 0 · Byte sum low byte: 0 · Input bytes: 0

What this tool does

  • Compute the trailing LRC for a Modbus ASCII frame from a pasted hex message.
  • Debug a serial device: find out whether the manual means two's-complement LRC or a plain sum.
  • Compare with BCC and CRC-16 to identify the checksum a device really uses.

Example

Input

abc

Output

26

Vector: LRC(abc) = da (sum mode gives 26). Hand check: 0x61+0x62+0x63 = 0x126, low byte 0x26, 0x100-0x26 = 0xda.

Frequently asked questions

Is LRC encryption?

No. It just adds up the bytes and negates the result; anyone can reproduce it and it offers no tamper resistance. Its only job is communication error checking.

Why does my result differ from someone else's?

Usually a convention difference: Modbus ASCII uses (256 - sum % 256) % 256 (the complement mode, the default here), while some implementations only emit sum % 256. Toggle the mode to compare.

How can I verify the result?

By hand: for abc the byte sum is 0x126, the low byte is 0x26, and the two's complement is 0x100 - 0x26 = 0xda — matching this tool.

Should the frame delimiters be included?

No. In Modbus ASCII the LRC covers only the bytes between the colon and CRLF, so the delimiters are excluded from the sum.

Keywords:LRCModbus ASCIIchecksum

Related tools