Parity Bit Calculator

Generate an even/odd parity bit or check a received word for single-bit errors.

What it does

A parity bit makes the number of 1s even (or odd), so a single flipped bit can be detected. Generate the bit, or check a received word.

Where it's used

UART serial frames, memory checks and simple communication links.

How to use it

  1. Choose generate or check.
  2. Type the bits. When checking, the parity bit is the last bit.
  3. Choose even or odd parity.

The formula explained

Even parity
p = XOR of all data bits
Odd parity
p = NOT(XOR of all data bits)

Worked example

Checking a received 8-bit word that uses even parity.

Inputs:

The calculator gives:

Tips and common mistakes

Questions people ask

Why does the example show a parity error?

10110011 contains five 1s. With even parity the total must be even, so one bit — possibly the parity bit itself — has flipped on the way.

Where is parity used?

UART serial links can add a parity bit to each character, and some memory and storage systems use it to detect corruption. It is cheap: one extra bit per word.

How do I calculate parity in code?

XOR all the bits together: the result is 1 when the number of 1s is odd. GCC and Clang provide __builtin_parity(x), which compiles to a single instruction on many processors.

Related Digital Logic calculators

Enter your values to get the result with the formula, substituted values and an explanation of each step.

All engineering calculators