A parity bit is the simplest error check in digital communication: one extra bit that makes the number of ones even or odd. This parity bit calculator converts a byte to binary, counts the ones, gives the parity bit for even or odd parity and checks whether a received parity bit is valid.
How the calculation works
- Binary form: write the byte as eight bits, for example 181 = 10110101.
- Count the ones in the data. 10110101 has five.
- Even parity: the parity bit makes the total number of ones, parity bit included, even. With five ones in the data the bit is 1, giving six.
- Odd parity: the parity bit makes the total odd. With five ones the bit is 0.
- Check: the receiver counts the ones in the data plus the parity bit. If the parity does not match, an odd number of bits has changed in transit.
Example
The byte 181 is 10110101 in binary and has 5 bits set to 1. With even parity the parity bit is 1, so the transmitted word has six ones. If the receiver gets the data with a parity bit of 1, the check passes, and with a parity bit of 0 it reports an error.
Why it matters
Parity is the first error-detection scheme taught in computer networking and embedded systems, and it is still used in serial ports and memory. Computing it by hand for each byte is slow and easy to get wrong, especially for odd parity, so a calculator helps when you debug a serial line, build a protocol exercise or check a textbook example.
Good to know
One parity bit catches all single-bit errors and any odd number of flips, but misses an even number of flipped bits, which is why it is weak on noisy links. It detects an error without locating or fixing it. Serial settings are written as 8E1, 8O1 or 8N1 for eight data bits, even, odd or no parity and one stop bit. For files and network packets, checksums and CRCs give much stronger protection.
Related tools
The hash collision calculator estimates the chance of duplicate identifiers, the subnet calculator splits IP networks and the Ethernet overhead calculator shows how much of a frame is payload.