Odd Parity Bit Calculator
Enter a binary message to find its odd parity bit. In Generate mode the calculator tells you the parity bit value and shows the full transmitted codeword with the bit inserted at your chosen position. In Check mode it reads an already-encoded message and tells you whether the parity is valid or a single-bit error was detected. Switch to even parity using the Parity Type selector.
What is a parity bit?
A parity bit is a single extra bit added to a binary message before it is transmitted. Its sole job is to make the total number of 1-bits in the message (data plus parity bit) either always odd or always even, depending on the scheme agreed between sender and receiver. When the message arrives, the receiver counts the 1s: if the count does not match the expected odd or even value, it knows that at least one bit changed during transmission. The parity bit is the simplest form of error detection, used in serial communication (RS-232, USB), DRAM memory, and basic networking protocols.
Odd parity vs even parity
Under odd parity the total number of 1-bits in the transmitted codeword must always be odd. If the data bits already contain an odd number of 1s, the parity bit is 0 (adding it would leave the count odd). If the data has an even number of 1s, the parity bit is 1 (adding it makes the count odd). Even parity works identically in reverse: the target is an even total, so the parity bit is 1 when the data contains an odd number of 1s and 0 when the data already has an even count. Both schemes detect the same errors; the choice between them is a protocol convention. Odd parity has one advantage: a codeword of all zeros is invalid (it would have zero 1-bits, which is even), so the link can distinguish "silence" from a valid zero byte.
How to calculate a parity bit: step by step
To generate an odd parity bit for any binary string: (1) Count the number of 1-bits in your data. (2) If that count is even, set the parity bit to 1, because adding a 1 will make the total odd. If the count is already odd, set the parity bit to 0. (3) Append (or insert at the agreed position) the parity bit to form the transmitted codeword. For example, data "1010110" has four 1-bits (even), so the odd parity bit is 1 and the codeword becomes "10101101". The receiver counts all eight bits, gets five (odd), and accepts the message. If during transmission the third bit flips from 0 to 1, the codeword becomes "10110101" with six 1-bits (even): the receiver detects a parity mismatch and requests a retransmission.
Limitations of parity checking
A single parity bit detects only an odd number of bit errors: one flip is caught, two simultaneous flips are not (the two changes cancel each other out and the count remains the same parity). It also cannot locate which bit is wrong, only that something changed. For memory and storage, designers often use more advanced schemes: Hamming codes can both detect and correct single-bit errors by using multiple parity bits across different subsets of the data. Cyclic Redundancy Check (CRC) uses polynomial division over the entire message and is far more robust for network packets and storage controllers. Parity bits remain useful when transmission errors are rare, bandwidth is extremely constrained, and a simple error flag is enough to trigger a retransmit.
Parity bit truth table (3-bit data)
| Data | Ones in data | Odd parity bit | Even parity bit | Odd codeword | Even codeword |
|---|---|---|---|---|---|
| 000 | 0 | 1 | 0 | 0001 | 0000 |
| 001 | 1 | 0 | 1 | 0010 | 0011 |
| 010 | 1 | 0 | 1 | 0100 | 0101 |
| 011 | 2 | 1 | 0 | 0111 | 0110 |
| 100 | 1 | 0 | 1 | 1000 | 1001 |
| 101 | 2 | 1 | 0 | 1011 | 1010 |
| 110 | 2 | 1 | 0 | 1101 | 1100 |
| 111 | 3 | 0 | 1 | 1110 | 1111 |
How the parity bit is chosen for every 3-bit combination under odd and even parity. The transmitted codeword is data + parity bit appended.
Frequently asked questions
What is the difference between odd and even parity?
Both schemes add a single bit to make the total count of 1-bits in the codeword match a target parity. Odd parity targets an odd total: the parity bit is 1 when the data has an even number of 1s, and 0 when it already has an odd number. Even parity targets an even total: the parity bit is 1 when the data has an odd number of 1s, and 0 when it already has an even number. The choice between them is a protocol convention; both detect the same single-bit errors.
What is the odd parity bit for "1010110"?
Count the 1s: the bits 1, 0, 1, 0, 1, 1, 0 contain four 1s, which is even. For odd parity the total in the codeword must be odd, so the parity bit is 1. The transmitted codeword is "10101101" (parity bit appended), which has five 1-bits, satisfying odd parity.
Can a parity bit detect all transmission errors?
No. A single parity bit detects only an odd number of flipped bits. If exactly one bit changes, the count parity flips and the error is caught. If two bits change simultaneously, their effects cancel: the count parity stays the same, and the error is invisible. For more reliable detection, CRC or Hamming codes are used instead.
Where is the parity bit placed in the message?
There is no universal rule. In many protocols the parity bit is appended at the end of the data (least-significant or most-significant side). In Hamming codes the parity bits occupy specific power-of-two positions (1, 2, 4, 8...) throughout the codeword. This calculator lets you specify the position (1-based) or default to appending it at the end.
Why does odd parity have an advantage over even parity?
Odd parity makes an all-zeros codeword invalid, because an all-zeros word has zero 1-bits (even), which violates odd parity. This means a dead link or stuck-at-zero fault is automatically flagged as a parity error. Under even parity, an all-zeros word is valid (zero is even), so that fault mode goes undetected.