Skip to content

Checksum Calculator

Calculate explicit XOR-8 BCC, Modbus ASCII two's-complement LRC, and byte-sum modulo 256 values from UTF-8 text or hex bytes.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Choose UTF-8 text or hexadecimal bytes according to the protocol's actual input representation.
  2. 2.Enter exactly the bytes covered by the checksum; omit framing characters only when the target specification says to omit them.
  3. 3.Calculate, compare the explicit XOR-8 BCC and Modbus ASCII LRC formulas with the device documentation, and copy the labeled results.

About Checksum Calculator

Checksum Calculator computes three clearly named one-byte values over the same input bytes: XOR-8 block check character, Modbus ASCII longitudinal redundancy check, and the raw sum modulo 256. Choose UTF-8 text or hexadecimal bytes, enter the payload, and run the calculation. The page shows two lowercase hex digits for each result and the exact number of bytes processed.

The word checksum is not one universal algorithm. Different devices and protocols use different initial values, byte ranges, widths, reflection rules, complements, byte orders, framing exclusions, and final transformations. This tool avoids a generic unexplained result. It declares the formulas it implements and does not claim compatibility with a protocol merely because that protocol uses the terms BCC, LRC, or checksum.

XOR-8 BCC starts at zero and XORs every selected byte into an eight-bit accumulator. XOR is commutative and carries are irrelevant. This simple block check character is used by some serial and device protocols, but other products can use BCC to mean an additive checksum, LRC, CRC, or a checksum over a different part of the frame. Confirm the vendor document before inserting the result.

The Modbus ASCII LRC adds every message byte into an eight-bit field, discards carries, and takes the two's complement of the final sum. Equivalently, the result is the negative byte sum modulo 256. The official serial-line guide excludes the starting colon and ending CRLF from the bytes supplied to the LRC calculation. This page does not remove framing automatically; enter only the exact bytes the target specification says to cover.

The sum modulo 256 is displayed as a diagnostic intermediate. It is the low eight bits of the ordinary byte sum before the Modbus two's-complement step. The sum and the LRC add to zero modulo 256. Showing both values makes it easier to spot whether a device description expects an additive total, the complement, or a different convention.

In hexadecimal mode, enter each byte as exactly two hex digits, with optional whitespace between bytes. Prefixes such as 0x, commas, colons, dashes, odd nibbles, and comments are rejected rather than guessed. In text mode, the browser encodes the string as UTF-8 first. Non-ASCII characters can therefore contribute several bytes, and the displayed byte count may exceed the visible character count.

These one-byte checks detect some accidental changes but are not cryptographic hashes, message authentication codes, digital signatures, encryption, or proof of origin. XOR and additive checksums have many collisions and can be deliberately adjusted. Do not use them to protect credentials, authorize commands, verify software downloads, or authenticate hostile network traffic. Use the security mechanism required by the actual protocol.

The page processes at most 500,000 bytes, never silently truncates input, and reports malformed hex without producing a partial value. Results are always exactly two lowercase hex digits, including leading zero. Copy output includes labels, all three values, and the byte count so a pasted diagnostic note retains the selected interpretation.

External fixtures cover empty and zero inputs, a single byte, rollover at ff, a representative Modbus request byte sequence, a multi-byte pattern, and the ASCII bytes for 123456789. The Modbus formula follows the official Modbus over Serial Line specification. XOR-8 BCC behavior is cross-checked against vendor documentation that explicitly defines an eight-bit XOR over selected bytes.

Before using a result, identify the input byte representation, checksum width, algorithm, initial value, included fields, final complement, and transmitted byte order in the target documentation. If a protocol says CRC-16, CRC-32, Fletcher, Adler, Internet checksum, or a named cryptographic hash, this calculator is the wrong tool. Its value is transparent reproduction of two simple eight-bit formulas, not automatic protocol detection.

Methodology & sources

XOR-8 BCC XORs every byte from zero. Modbus ASCII LRC sums bytes modulo 256 and returns the two's complement, equal to negative sum modulo 256. UTF-8 text is encoded before calculation; hex is parsed as explicit bytes.

Frequently asked questions

Encoding & Crypto guides

View all