What Is a Parity Bit?
A parity bit is a single extra bit added to a block of binary data to help detect transmission or storage errors. It is chosen so that the total number of 1s — the data bits plus the parity bit — is either even (even parity) or odd (odd parity). If a single bit flips somewhere along the way, the count no longer matches the agreed parity and the receiver knows an error occurred. It is the simplest and cheapest form of error detection in digital systems. This calculator generates the parity bit for any data you enter, shows the count of 1s, the full transmitted word, and how a single XOR produces the result.
How to Use This Calculator
1. Choose even or odd parity. 2. Enter your binary data (any string of 0s and 1s, up to 32 bits). 3. Pick where the parity bit goes — at the start (MSB) or the end (LSB). The parity bit, the count of 1s, the transmitted word and the XOR working all update instantly. The result panel confirms whether the total number of 1s is even or odd.
Even Parity vs Odd Parity
With even parity, the parity bit is set so the total number of 1s is even. With odd parity, it is set so the total is odd. The two are simply inverses of each other for the same data.
| Data | 1s in data | Even parity bit | Odd parity bit |
|---|---|---|---|
| 0000 | 0 (even) | 0 | 1 |
| 1011 | 3 (odd) | 1 | 0 |
| 1100 | 2 (even) | 0 | 1 |
| 1111111 | 7 (odd) | 1 | 0 |
Even Parity Calculator
As an even parity calculator, this tool sets the parity bit so the total number of 1s (data plus parity) is even. If your data already has an even number of 1s, the even parity bit is 0; if it has an odd number of 1s, the even parity bit is 1. Equivalently, the even parity bit is the XOR of all the data bits. Select EVEN above and type your bits to generate it instantly.
Odd Parity Calculator
As an odd parity calculator, it sets the parity bit so the total number of 1s is odd — the exact opposite of even parity. If the data has an even number of 1s, the odd parity bit is 1; if odd, it is 0. Select ODD above to switch. The odd parity bit is simply the inverse of the even parity bit for the same data.
Parity Bit Examples (3-bit, 4-bit, 5-bit)
| Data | Bits | 1s | Even parity word | Odd parity word |
|---|---|---|---|---|
| 101 | 3 | 2 | 101 0 | 101 1 |
| 1011 | 4 | 3 | 1011 1 | 1011 0 |
| 10110 | 5 | 3 | 10110 1 | 10110 0 |
| 11001010 | 8 | 4 | 11001010 0 | 11001010 1 |
Using Check Mode as a Parity Checker
Switch to Check mode to act as a parity checker. Enter a received word that already includes its parity bit, and the calculator recomputes the parity of the data portion and compares it with the received parity bit. A green banner means the parity is valid; a red banner means an odd number of bits flipped in transit and the data should be rejected or resent. This mirrors exactly what a UART or memory controller does on the receiving end.
How to Calculate a Parity Bit
Example — even parity for 1011001
The data 1011001 contains four 1s, which is already even. For even parity, the parity bit is 0, and the transmitted word is 0 1011001. For odd parity you would use 1, giving 1 1011001 with five 1s.
The Parity Bit Is Just XOR
There is a neat shortcut: the even parity bit equals the XOR of all the data bits. XOR outputs 1 whenever there is an odd number of 1s, which is exactly when an even-parity bit must be 1 to balance the count. The odd parity bit is simply the inverse. That is why hardware parity generators are built from a chain of XOR gates — explore the gate itself in the Logic Gate Calculator.
How Parity Detects Errors (and Its Limits)
The receiver recomputes the parity of the data it received and compares it with the parity bit that arrived. If they disagree, an odd number of bits flipped — usually a single-bit error — and the data is rejected or re-requested. Parity is fast and cheap, but it has limits: it cannot detect an even number of errors (two flipped bits cancel out), and it cannot locate or correct the error. For those needs, engineers use stronger schemes like checksums, CRC, or Hamming codes, which can pinpoint and even fix errors.
Where Parity Bits Are Used
Parity appears throughout computing: parity RAM and ECC memory, serial ports and UARTs (the "E" in an 8-E-1 setting means even parity), older SCSI and PCI buses, and many communication protocols. It is the entry point to the whole field of error-detecting and error-correcting codes. To work with the underlying binary, use the Binary Calculator or the Number System Converter; to see the XOR gate that powers parity, visit the Logic Gate Calculator.
Want to correct errors, not just detect them? The Hamming Code Calculator uses several parity bits to locate and fix a single-bit error automatically.
Frequently Asked Questions
What is a parity bit?
An extra bit added to binary data so the total number of 1s is even (even parity) or odd (odd parity). It lets a receiver detect single-bit errors.
What is the difference between even and odd parity?
Even parity makes the total number of 1s even; odd parity makes it odd. For the same data the two parity bits are always opposite.
How is a parity bit calculated?
Count the 1s in the data. For even parity the bit is 0 if the count is even, else 1; for odd parity it is the reverse. Equivalently, the even parity bit is the XOR of all data bits.
How does a parity bit detect errors?
The receiver recomputes parity and compares. A mismatch means an odd number of bits flipped. Parity catches all single-bit errors but misses even-numbered errors and cannot correct them.
What is parity used for?
Cheap error detection in memory, serial communication (UART), and older buses. Stronger schemes like CRC and Hamming codes are used where correction is needed.
How do you calculate a 4-bit even parity bit?
Count the 1s in the 4 data bits. If even, the even parity bit is 0; if odd, it is 1. For 1011 (three 1s), the even parity bit is 1, giving the word 10111 or 11011 depending on the parity position.
What is a parity checker?
A tool that recomputes the parity of received data and compares it with the received parity bit. If they differ, an odd number of bits flipped. This calculator's Check mode does exactly that.
Is the even parity bit the same as XOR of the bits?
Yes. XOR is 1 when there is an odd number of 1s, exactly when an even parity bit must be 1. XORing all data bits gives the even parity bit; inverting it gives the odd parity bit.