Parity Bit Calculator

Compute the parity bit for a binary data string using even or odd parity, and see the complete transmitted codeword with its 1-bit count.

Quick Facts

Formula
Parity bit = b1 XOR b2 XOR ... XOR bn
Even parity uses that result directly; odd parity uses its opposite.
Detection limit
Catches any single-bit error
Cannot detect 2, 4, or any even number of simultaneous bit flips.

Your Results

Calculated
Parity bit
-
Value to add (0 or 1)
1-bits in data
-
Count of set bits entered
Transmitted codeword
-
Data bits plus the parity bit
Total 1-bits (check)
-
Should match selected parity

Ready

Enter a binary string and choose a parity type, then press Calculate.

Understanding the Parity Bit

A parity bit is a single extra bit appended to a group of data bits — a byte, a word, or any fixed-size block — so that the total number of 1-bits in the combined string always matches a chosen convention: always even (even parity) or always odd (odd parity). It is the oldest and simplest error-detecting code in digital systems, used in serial links like RS-232, early parity-checked RAM, and simple checksums where a lightweight sanity check matters more than correcting the error.

The formula

The parity bit is computed as the exclusive-OR (XOR, written ⊕) of every data bit:

  • XOR of data bits: x = b1 ⊕ b2 ⊕ ... ⊕ bn. This equals 1 if the data contains an odd number of 1s, and 0 if it contains an even number of 1s.
  • Even parity bit: p = x. Appending p makes the total count of 1s (data + parity) even, because a data string with an odd number of 1s gets a 1 added (making it even), and a string with an even number of 1s gets a 0 added (staying even).
  • Odd parity bit: p = NOT(x) = 1 ⊕ x. This forces the total count of 1s to always be odd instead.

Worked example

Take the 7-bit data string 1011001. Counting the 1s gives four (positions 1, 3, 4, and 7), which is already even.

  • Even parity: since the data already has an even number of 1s, the parity bit is 0. The transmitted codeword becomes 10110010, still four 1s — even.
  • Odd parity: the parity bit must flip that to odd, so it is 1. The codeword becomes 10110011, five 1s — odd.

The receiver repeats the same count on the full codeword. If the result does not match the agreed parity (even or odd), the receiver knows at least one bit changed in transit and can request a retransmission.

What a parity bit can and cannot catch

A single parity bit reliably flags any odd number of bit flips — 1, 3, 5, and so on — because each flip toggles the overall 1-count's parity. It is blind to an even number of flips (2, 4, ...), since those cancel out and leave the count's parity unchanged. It also cannot say which bit was corrupted or fix it — only that something disagrees with the expected total. Systems that need to locate or correct errors use stronger codes such as Hamming codes (single-error-correcting, double-error-detecting) or a CRC (cyclic redundancy check), both of which use more bits than a single parity bit but catch far more error patterns.

Frequently Asked Questions

What is a parity bit?
A parity bit is one extra bit added to a group of data bits so the total count of 1-bits is always even (even parity) or always odd (odd parity). It is the simplest form of error-detecting code, letting a receiver spot a single-bit transmission or storage error by recounting the 1s and comparing against the expected parity.
How do you calculate a parity bit?
Compute the XOR (exclusive OR) of every data bit: b1 XOR b2 XOR ... XOR bn. For even parity, use that XOR result directly as the parity bit, which forces the total number of 1s (data plus parity) to be even. For odd parity, use the opposite of that result, forcing the total to be odd.
What is the difference between even and odd parity?
Even parity sets the parity bit so the data-plus-parity bit string contains an even number of 1s. Odd parity sets it so that count is odd. Both catch exactly the same errors; the choice between them is a system convention agreed upon by sender and receiver in advance, such as RS-232 serial links or parity-checked memory.
What errors can a parity bit detect and what can it miss?
A single parity bit reliably detects any odd number of bit flips (1, 3, 5, ...) because each flip changes the 1-count's parity. It cannot detect an even number of flips (2, 4, ...), since those cancel out and leave the parity unchanged, and it cannot identify which bit was corrupted or correct the error — it only flags that something changed.