Parity is the oldest and cheapest error-detection trick in computing: count the 1 bits and remember whether that count is even or odd. This tool tells you the parity of any integer and, for both the even-parity and odd-parity conventions, exactly which bit you would append to a frame.
How it works
The tool counts the set bits in your value and takes that count modulo 2:
ones = number of 1 bits in the value
data parity = ones mod 2 // 0 = even, 1 = odd
even bit = data parity // appended, keeps the total even
odd bit = 1 − data parity // appended, keeps the total odd
For even parity the appended bit makes the overall number of 1 bits even; for odd parity it makes the overall count odd. A receiver recomputes parity over the data plus the parity bit and flags an error if it does not match the agreed scheme. A single flipped bit always changes the count, so it is always caught.
Example and notes
The byte 182 is 10110110, which contains five 1 bits — an odd number, so its
data parity is odd. To transmit it under even parity you would append a 1
(making six 1 bits, even); under odd parity you would append a 0 (leaving five,
odd). Parity cannot locate or correct the error, only detect it, and it misses
errors that flip an even number of bits — that is why robust systems layer CRCs
or Hamming codes on top.
Where parity checking is used
Parity remains relevant in several real-world settings, each using it slightly differently:
UART serial communication Most microcontrollers and serial terminals allow you to configure the parity bit as None, Even, Odd, or the less common Mark (always 1) or Space (always 0). Even parity is the most common choice when parity is enabled. A UART parity error triggers a status flag in the hardware register, signalling that the received byte should be discarded and a retransmission requested.
ECC RAM modules Error-Correcting Code memory extends the parity concept significantly. A 64-bit data bus paired with 8 additional check bits uses a Hamming-based scheme that can not only detect but also correct single-bit errors, and detect (though not correct) double-bit errors. The additional bits are computed by applying several parity checks over different subsets of the data bits.
RAID 3 and RAID 5 Block-level storage RAID calculates a parity stripe across the data drives. In RAID 3, the parity is on a dedicated drive; in RAID 5, the parity is distributed across all drives. In either case, if one drive fails, the missing data can be reconstructed by XORing the surviving drives — the same logic as the parity bit, extended to large blocks.
Network protocols and magnetic tape Older protocols and backup tape formats use Longitudinal Redundancy Checks (LRC), which are essentially parity bytes computed over rows and columns of a data frame, catching more errors than a single parity bit.
Error detection limits
A single parity bit catches any odd number of bit flips in a group: 1, 3, 5, and so on. It misses any even number of flips — two errors cancel out perfectly, leaving the parity unchanged. For most communication channels where burst errors are rare, this is acceptable. Where bursts or corruption affecting multiple bits are a real risk (radio links, flash storage), CRC codes or Reed-Solomon error correction are used instead.