Parity and Checksum Calculator
Work out the simple checksums of a message: XOR, sum, two’s-complement LRC, the Internet checksum, Fletcher-16 and the parity bit. Enter bytes as hex or text and see each one worked out.
How to Use
- Choose whether you are entering hex bytes (01 03 0A or 01030A) or text (encoded as UTF-8).
- Type or paste the message.
- Read the XOR checksum, the sum mod 256, the two’s-complement LRC and the Internet checksum.
- The table adds the 16-bit sum, Fletcher-16 and the even and odd parity bits.
- The drawing stacks the bytes in binary so you can see the XOR as the parity of each bit column.
Worked Example
A Modbus ASCII frame: 01 03 00 00 00 0A. Add the bytes: 1 + 3 + 0 + 0 + 0 + 10 = 14 = 0x0E. The LRC is the two’s complement, 0x100 − 0x0E = 0xF2, so that the bytes and the LRC add up to 0x100, which is 0 modulo 256. The receiver adds everything and checks for zero.
The Internet checksum of 00 01 F2 03 F4 F5 F6 F7 (the example in RFC 1071). As 16-bit words: 0x0001 + 0xF203 + 0xF4F5 + 0xF6F7 = 0x2DDF0. Fold the carry: 0xDDF0 + 0x2 = 0xDDF2. Invert: 0x220D.
The common mistake: two kinds of LRC. Modbus and Intel HEX use the two’s-complement sum (0xF2 above), while many serial protocols call the XOR of the bytes an LRC (0x08 for the same frame). Using the wrong one gives a checksum that is consistently rejected.
Show Work
Formulas
Cheap Ways to Catch Errors
Parity bits are as old as electronic data: punched-paper tape had a parity track, and early memory and serial links added one bit per character. Simple sums and XORs followed for whole blocks, chosen because they cost almost nothing to compute in hardware or on an 8-bit microcontroller. The Internet checksum of 1988’s RFC 1071 was designed the same way: fast to update when a router changes one field of a header.
John Fletcher’s checksum, published in 1982, adds a second running sum that weights each byte by its position, so it catches reordered bytes that a plain sum misses. Cyclic redundancy checks go further still, which is why Ethernet, ZIP files and storage use CRCs while these simpler checks live on in protocols such as Modbus and in IP headers.
About This Calculator
This calculator works out the XOR checksum (BCC), the byte sum mod 256 and mod 65,536, the two’s-complement LRC, the RFC 1071 Internet checksum, Fletcher-16 and the even and odd parity bits for a message entered as hex bytes or as text, which is encoded as UTF-8. It shows each calculation and draws the bytes in binary above their XOR.
Everything runs in your browser; nothing is sent anywhere. For CRC-8, CRC-16 and CRC-32, use the CRC calculator.
Related calculators: CRC Calculator, Hamming Code Calculator, and Bitwise Calculator.
Frequently Asked Questions
What is a parity bit?
One extra bit that makes the number of 1s even (even parity) or odd (odd parity). The byte 0x07 has three 1s, so its even parity bit is 1. It detects any single flipped bit, but not two, which is why serial links that use it also rely on retries or better checks.
What is an XOR checksum?
All the bytes combined with exclusive OR, also called a block check character (BCC). Each bit of the result is the parity of that bit position across the message, so it is a parity check on 8 columns at once. 01 02 03 04 gives 04.
What is an LRC?
A longitudinal redundancy check. In Modbus ASCII and Intel HEX files it is the two’s complement of the byte sum, so that adding every byte and the LRC gives 0 modulo 256. For 01 03 00 00 00 0A the sum is 0x0E and the LRC is 0xF2. Some protocols call the XOR checksum an LRC instead, so check the specification.
How is the Internet checksum calculated?
Treat the data as 16-bit big-endian words, add them, fold any carry above 16 bits back into the bottom, and invert the result (RFC 1071). It protects IPv4, TCP and UDP headers. For the bytes 00 01 F2 03 F4 F5 F6 F7 the folded sum is 0xDDF2 and the checksum is 0x220D.
Are these checksums good enough?
For catching noise on a short link, often yes. But none of them notices bytes that are swapped, and simple sums miss many double errors. Fletcher checksums are better, CRCs much better, and only a cryptographic hash such as SHA-256 protects against deliberate changes.
How do I use the Parity and Checksum Calculator?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Does it cost anything or need an account?
No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.
Is anything I type uploaded?
No. The tool works entirely on your device, so the values you enter never leave your browser.
Common Use Cases
Modbus ASCII
01 03 00 00 00 0A has an LRC of F2.
Networking
RFC 1071’s example 00 01 F2 03 F4 F5 F6 F7 has the Internet checksum 0x220D.
Serial protocols
The XOR (BCC) of 02 31 32 03 is 0x02.
Text
Fletcher-16 of “abcde” is 0xC8F0.
Last updated: