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
- Choose generate or check.
- Type the bits. When checking, the parity bit is the last bit.
- 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:
- Mode: Check received word (parity bit last)
- Bits: 10110011
- Parity: Even
The calculator gives:
- Result: Parity error!
- Data bits: 1011001
Tips and common mistakes
- Parity detects any odd number of flipped bits, but misses two flips.
- Both ends must agree on even or odd.
- Parity only detects errors — use Hamming code to correct them.
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
- Binary Calculator
- Number System Converter
- Logic Gate Calculator
- Two's Complement Calculator
- Hamming Code Calculator
- Truth Table Generator
- Karnaugh Map Solver
- Gray Code Converter
- Bitwise Calculator
- Bit Shift Calculator
Enter your values to get the result with the formula, substituted values and an explanation of each step.