FREE ONLINE BINARY TOOL

Parity Bit Calculator

Generate and check even or odd parity bits in seconds. Enter binary data, hexadecimal bytes or text to calculate the parity bit, inspect the number of set bits, and test whether a received data group has a parity error.

Parity bit generator and checker

Enter only 0 and 1. Spaces and common separators are ignored.
0 bits
The data plus the generated parity bit will contain an even number of 1 bits.

Parity at a glance

Even parity

The total number of 1 bits, including the parity bit, must be even. If the data has an odd number of 1s, the parity bit is 1.

Odd parity

The total number of 1 bits, including the parity bit, must be odd. If the data already has an odd number of 1s, the parity bit is 0.

Error detection

A parity mismatch can detect an odd number of flipped bits in the protected group. A parity bit cannot locate the error.

Example: data 1011001 contains four 1 bits. Its even parity bit is 0, while its odd parity bit is 1.

This calculator runs in your browser. Text is converted to UTF-8 bytes before the bits are counted.

How parity bits work

A parity bit is an extra bit added to binary data to make the total number of 1 bits follow a chosen rule. The two common rules are even parity and odd parity. A sender calculates the bit before transmitting the data, and the receiver checks the combined data and parity bit.

Data Number of 1s Even parity bit Odd parity bit
0000 0 0 1
0001 1 1 0
1010 2 0 1
1011 3 1 0
1111 4 0 1

Parity bit calculation formula

Let ones be the number of 1 bits in the data. The even parity bit is the remainder of ones divided by 2. The odd parity bit is the opposite bit.

Even parity: parity bit = ones % 2
Odd parity: parity bit = 1 - (ones % 2)

Equivalently, the even parity bit is the XOR of all data bits. The odd parity bit is the inverse of that XOR result.

How to use the parity bit calculator

  1. Choose binary, hexadecimal or text input.
  2. Enter the data you want to check. In binary mode, only 0 and 1 are accepted apart from separators.
  3. Select even or odd parity.
  4. Choose whether to generate a new parity bit or verify a received parity bit.
  5. Click Calculate parity to see the result and a visual representation of the bits.
When verifying, select the parity bit that was received with your data. The tool checks whether the combined number of 1 bits satisfies the selected parity rule.

Frequently asked questions

What is a parity bit?

A parity bit is an additional binary digit used for basic error detection. It makes the total number of 1 bits either even or odd, according to the selected convention.

What is the difference between even and odd parity?

With even parity, the data and parity bit must contain an even number of 1s. With odd parity, their combined number of 1s must be odd.

Can a parity bit detect a single-bit error?

Yes. If one bit changes from 0 to 1 or from 1 to 0, the parity changes, so a receiver checking the same parity convention can detect a mismatch.

Can parity detect two-bit errors?

Not necessarily. If two bits flip, the parity may remain valid. More generally, a simple parity bit detects an odd number of bit flips but cannot detect an even number of flips.

Does parity correction identify the wrong bit?

No. A single parity bit only indicates whether the parity check passes or fails. It cannot determine which bit changed or correct the data. More advanced error-correcting codes are needed for that.

How is parity used in serial communication?

Some serial communication configurations add a parity bit to each data character. A receiver checks the received character and parity bit to detect certain transmission errors. Both sides must agree on the parity setting.

How does text input work?

Text is encoded as UTF-8 bytes. The calculator counts all bits in those bytes together to generate one parity bit for the complete input, rather than a separate parity bit for every character.