Parity & Checksum Calculator — Parity Bit, XOR, Modular Sum, LRC & Internet Checksum
Compute the common simple integrity checks for a sequence of bytes side by side: even/odd parity bit, XOR checksum, modular sum (mod 256 / mod 65536), two’s-complement checksum, LRC, and the RFC 1071 one’s-complement Internet checksum. Enter bytes as hex or as text — live in your browser, with hex/decimal/binary for every result.
How to Use
- Pick how you are entering data: <b>Hex bytes</b> (e.g. <code>01 02 03</code>) or <b>ASCII text</b> (each character becomes its byte).
- Type your bytes — every checksum below updates instantly.
- Read each result in hexadecimal, decimal and binary.
- Click any value (or its Copy button) to copy it to the clipboard.
Every simple integrity check, side by side
Before a message reaches its destination — down a serial wire, across a packet network or onto a disk — a few extra bits are usually appended so the receiver can tell whether the bytes arrived intact. This calculator takes a sequence of bytes (typed as hex, or as text whose character codes become the bytes) and computes the whole family of simple integrity checks at once: the parity bit, an XOR checksum, a modular sum, the two’s-complement checksum and its serial-protocol twin the LRC, and the 16-bit one’s-complement Internet checksum from RFC 1071. Each result is shown in hexadecimal, decimal and binary, and everything runs in your browser — nothing is uploaded.
How each check is computed
Parity counts the 1-bits across every byte. The even-parity bit is 0 when that count is already even (so the grand total stays even) and 1 otherwise; the odd-parity bit is its inverse. The XOR checksum folds all bytes together with exclusive-OR — fast and carry-less, but blind to a byte being duplicated or two bytes swapping places. The modular sum simply adds the byte values and keeps the low 8 bits (mod 256) or low 16 bits (mod 65536). The two’s-complement checksum is (256 − sum) mod 256, chosen so that bytes + checksum ≡ 0 (mod 256); the LRC used by Modbus ASCII is exactly this value. The Internet checksum sums the data as 16-bit words using end-around-carry (one’s-complement) addition, padding an odd final byte with zero, then takes the bitwise NOT of the result — the receiver re-sums everything including the checksum and expects 0xFFFF.
Which check catches what — and where CRC fits
A single parity bit detects any odd number of flipped bits but nothing even; an 8-bit XOR or sum catches more, yet a plain XOR misses re-ordered bytes that a sum would flag, and an 8-bit sum still rolls over on large errors. Complement checksums (two’s-complement / LRC and the one’s-complement Internet checksum) are popular because verification is trivial — sum to a known constant. For genuinely strong error detection you want a polynomial Cyclic Redundancy Check; CRC-8/16/32 with selectable polynomials lives in our separate CRC Calculator, since it is a different algorithm family from the simple sums here.
Quick reference
About the Parity & Checksum Calculator — Parity Bit, XOR, Modular Sum, LRC & Internet Checksum
Parity & Checksum Calculator — Parity Bit, XOR, Modular Sum, LRC & Internet Checksum is a quick, free tool for everyday tasks. It works in your browser and keeps everything on your device. Compute the common simple integrity checks for a sequence of bytes side by side: even/odd parity bit, XOR checksum, modular sum (mod 256 / mod 65536), two’s-complement checksum, LRC, and the RFC 1071 one’s-complement Internet checksum. Enter bytes as hex or as text — live in your browser, with hex/decimal/binary for every result.
How it works
Enter your figures and the result appears instantly, updating the moment you change anything. There is no submit button and nothing to wait for, so it is easy to try a few what-if numbers and compare the results. Just check each box holds the kind of value it expects.
Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.
Frequently Asked Questions
What is a parity bit?
A parity bit is a single extra bit chosen so the total number of 1-bits in the data plus the parity bit is even (even parity) or odd (odd parity). It is the simplest error-detection scheme: a receiver recounts the 1-bits and, if the parity no longer matches, knows a single bit flipped. It cannot detect an even number of flipped bits, and cannot correct anything.
What is the difference between a sum, an XOR and an LRC checksum?
They are all one-byte “fold” of the message. The <b>XOR checksum</b> XORs every byte together (carry-less). The <b>modular sum</b> adds the bytes and keeps the low 8 (or 16) bits. The <b>two’s-complement checksum</b> / <b>LRC</b> is 256 minus the 8-bit sum, so that the bytes plus the checksum add up to zero mod 256 — a receiver simply sums everything and expects 0. LRC (Longitudinal Redundancy Check) is exactly this two’s-complement-of-the-sum value, used by Modbus ASCII and many serial protocols.
What is the Internet (one’s-complement) checksum?
It is the checksum used by IP, TCP and UDP, defined in RFC 1071. The data is treated as a sequence of 16-bit words which are summed using <i>one’s-complement</i> addition (any carry out of bit 15 is added back in, “end-around carry”). The final checksum is the one’s-complement (bitwise NOT) of that sum. An odd trailing byte is padded with a zero byte. The receiver sums the words including the checksum and expects all-ones (0xFFFF).
Where is CRC?
This tool deliberately covers the simple parity / sum / XOR / LRC family. A full Cyclic Redundancy Check — CRC-8, CRC-16, CRC-32 with selectable polynomials — is a different beast and lives in our dedicated <a href="https://utilitiesbunker.com/tools/crc-calc">CRC Calculator</a> in the Electronics category.
Is anything uploaded?
No. Every calculation runs in your browser with JavaScript — your bytes never leave the page.
How do I use the Parity & Checksum Calculator — Parity Bit, XOR, Modular Sum, LRC & Internet Checksum?
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
Serial & embedded protocols
Work out the LRC for a Modbus ASCII frame, or the XOR checksum used by NMEA, MIDI SysEx and many homebrew UART protocols.
Debugging packets
Hand-verify the one’s-complement checksum of an IP/UDP/TCP header captured in Wireshark.
Teaching error detection
Show students how parity, sum and complement checksums differ — and why an XOR misses transposed bytes that a sum would catch.
Quick byte arithmetic
Get the set-bit (population) count, byte sum and XOR fold of a short hex string without writing a script.
Last updated: