What Is an Odd Parity Bit?
A parity bit is a single extra bit appended to a block of binary data to enable basic error detection. With odd parity, the parity bit is chosen so that the total number of 1s — counting the data bits plus the parity bit itself — is always odd. This calculator counts the 1s in your binary string and outputs the parity bit (0 or 1) needed to satisfy the odd-parity rule.
How to Use the Calculator
Enter your binary data string (only the characters 0 and 1). The calculator counts how many 1s are present. If that count is already odd, the parity bit is 0 (no change needed). If the count is even, the parity bit is 1 so that adding it makes the total odd.
The Formula Explained
Let the data contain a number of 1s equal to k. The odd parity bit is computed as \(P = (k + 1) \bmod 2\). Equivalently, \(P = 1\) when \(k\) is even and \(P = 0\) when \(k\) is odd. The transmitted codeword becomes the original data with \(P\) appended, guaranteeing an odd total of 1s.
$$P = \begin{cases} 1 & \text{if } \left(\sum \text{ones in bits}\right) \bmod 2 = 0 \\ 0 & \text{otherwise} \end{cases}$$
Worked Example
Take the data 1011001. Counting the 1s: positions with a 1 are 1, 1, 1, 1 — that's 4 ones, an even number. To make the total odd we need to add one more 1, so the parity bit is 1. The full codeword is 10110011, which has 5 ones (odd). If the data were 1011000 (3 ones, already odd), the parity bit would be 0.
FAQ
What's the difference between odd and even parity? Even parity makes the total number of 1s even; odd parity makes it odd. This tool uses odd parity.
Can parity detect all errors? A single parity bit detects any odd number of bit flips, but it cannot detect an even number of errors, nor can it locate or correct errors.
Where is parity used? Parity bits appear in serial communication (UART), memory systems, and many simple data-integrity checks.