Automation Glossary • Modbus LRC Checksum

What Is the Modbus LRC Checksum?

Merobix Engineering • • 7 min read

The LRC, a longitudinal redundancy check, is the single-byte checksum that Modbus ASCII uses in place of the RTU CRC. Anyone reading an ASCII capture or wondering why ASCII is considered less robust than RTU needs to understand what the LRC is and how it compares. This reference explains how the LRC is formed, why it is weaker than a CRC, and where you meet it.

Back to Blog

Modbus LRC Checksum in one line: The Modbus LRC is a single-byte longitudinal redundancy check used only in Modbus ASCII mode. It is formed by summing the message bytes and taking the two's complement, giving one check byte carried as two hex characters before the frame's carriage-return line-feed. It is simpler than the RTU CRC-16 but weaker at catching errors, which is one reason RTU is preferred.

How the LRC Is Formed

In Modbus ASCII the LRC is a single byte computed by adding up the message bytes and taking the two's complement of the sum, so the check byte plus the running total wraps to zero. It is placed just before the carriage-return line-feed that ends the ASCII frame and, like everything in ASCII mode, is transmitted as two printable hex characters. The receiver recomputes the sum and verifies the result, discarding the message if it does not check out.

Because ASCII frames are delimited by an explicit colon start and CR-LF end rather than by timing, the LRC only has to protect content, not framing, which is handled by those delimiters. The overall structure of an ASCII frame and how it differs from RTU is laid out in the Modbus RTU vs ASCII transmission mode reference.

LRC Versus CRC and Where You Meet It

A longitudinal redundancy check is a sum-based check, and a sum is a weaker error detector than a cyclic redundancy check: some combinations of bit errors cancel out in a sum and slip through, whereas the CRC-16 catches burst errors far more reliably. This is the central technical reason RTU, which uses the CRC covered in the Modbus CRC-16 checksum reference, is considered more robust than ASCII on noisy links.

In practice you meet the LRC only on the legacy or specialized equipment that still uses ASCII mode, which is a small fraction of serial Modbus today. When troubleshooting such a link, remember that the LRC gives less assurance against undetected corruption than a CRC would, so persistent oddities on a marginal ASCII line deserve extra scrutiny. Neither checksum appears on TCP, which relies on the network as the Modbus TCP vs RTU comparison notes.

A Worked LRC Example

Take the common request to read ten holding registers starting at address zero from unit 1. The message bytes before ASCII encoding are the unit address 0x01, the function code 0x03, the starting address as two bytes 0x00 0x00, and the quantity as two bytes 0x00 0x0A. Summing them gives 0x01 + 0x03 + 0x00 + 0x00 + 0x00 + 0x0A = 0x0E. The LRC is the two's complement of that sum: invert 0x0E and add one, or equivalently subtract it from 0x100, giving 0xF2. The transmitted frame therefore carries the characters F and 2 just before the closing carriage-return line-feed.

The receiver's check is the mirror image: it adds every message byte including the LRC itself and keeps only the low eight bits. Here 0x0E plus 0xF2 is 0x100, which truncates to 0x00, so the frame passes. Any single corrupted byte changes the sum and the wrap-to-zero test fails. Working one example by hand like this is worth doing once, because it makes captures of ASCII traffic far easier to sanity-check when a link is misbehaving.

Checking the LRC in a Captured Frame

To verify a frame from a serial capture, take the printable characters between the leading colon and the closing carriage-return line-feed, pair them up into bytes, and set the final pair aside as the received LRC. Sum the remaining bytes, keep the low eight bits, take the two's complement, and compare against that final pair. If you do this often, a short script pays for itself, but the arithmetic is simple enough to do by hand for a single suspect frame.

Three mistakes account for almost every did-not-match result. First, summing the ASCII character codes instead of the byte values they encode - the LRC is computed over the underlying bytes, not the characters that carry them. Second, including the colon or the line ending in the sum; the delimiters sit outside the checksum. Third, forgetting to truncate the running total to eight bits before taking the complement. It also helps to remember that ASCII mode uses seven data bits on the wire per the Modbus specification, so an analyzer configured for eight-bit RTU will mangle the characters before you ever get to the arithmetic. How the pieces of a frame fit together is covered in the ADU and PDU structure reference.

What LRC Errors Tell You About the Link

A device that silently discards frames with bad LRCs looks, from the master's side, like a timeout: the request went out and nothing came back. So a rising timeout count on an ASCII link is often really a checksum problem in disguise, and the general approach to fixing a Modbus timeout applies, with the extra step of inspecting captured frames for check failures before blaming the device.

The pattern of failures narrows the cause. Occasional bad frames on an otherwise working link point to electrical noise, marginal wiring, or a baud rate at the edge of what the cable run supports - the same physical-layer suspects behind CRC errors on an RTU link. Every frame failing points instead at configuration: one end set to RTU and the other to ASCII, or mismatched parity and data bits, either of which turns every message into garbage no checksum can pass. And because a sum is a weak detector, a marginal ASCII link that mostly works deserves less trust than the same symptom on RTU - some corrupted frames will slip through undetected, so fix the physical problem rather than tolerating the error rate.

Frequently Asked Questions

How is the Modbus LRC calculated?

The LRC is one byte formed by summing all the message bytes and taking the two's complement of that sum, so the check byte plus the total wraps to zero. It sits just before the carriage-return line-feed at the end of an ASCII frame and, like the rest of ASCII mode, is sent as two printable hex characters.

Is the LRC weaker than the CRC?

Yes. The LRC is a sum-based check, and certain combinations of bit errors cancel in a sum and go undetected, whereas the CRC-16 used by RTU catches burst errors far more reliably. This weaker error detection is a key reason RTU is preferred over ASCII on electrically noisy serial links.

Where would I encounter a Modbus LRC?

Only in Modbus ASCII mode, which survives mainly on legacy or specialized serial equipment. The overwhelming majority of serial Modbus in service uses RTU with a CRC. Modbus TCP uses neither an LRC nor a CRC, relying on TCP's own integrity, so the LRC is specifically an ASCII-mode artifact.

Does the LRC cover the colon and CR-LF delimiters?

No. The LRC is computed over the message bytes only - address, function code, and data - before they are encoded as ASCII characters. The colon start and the carriage-return line-feed end sit outside the checksum; they handle framing while the LRC protects content. That split is why including the delimiters in a hand calculation is a classic way to get the wrong answer.

Can I tell ASCII from RTU just by looking at a capture?

Usually, yes. ASCII frames start with a colon, end with carriage-return line-feed, and consist entirely of printable hex characters, with the two-character LRC just before the line ending. RTU frames are raw binary with a two-byte CRC and no printable structure. If a capture reads as tidy lines of hex text, you are looking at ASCII mode and the check value in it is an LRC.

Sources and verification

This page references the protocol specifications published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.

Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.

More in Industrial Protocols
Modbus CRC-16 Checksum  •  Add a Modbus node to a live bus  •  Bisect an RS-485 Modbus bus  •  Choose Modbus float word order  •  Clear a Modbus illegal data address exception  •  All Industrial Protocols →
Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →