Parity is the oldest error check in computing — one extra bit that catches a flipped neighbour — and it still rides inside memory chips, serial links and RAID arrays. This Parity Bit Calculator takes a binary string and computes both its even and odd parity bits, shows the complete codewords, and checks any received word you paste back in.



Worked Example: The Byte 1011010

Count the ones: 1011010 contains four 1s — an even count already. The even parity bit is 0, because even parity’s rule is that the total number of ones, data plus parity bit, must be even; nothing needs adding. The odd parity bit is 1, because odd parity demands an odd total, and four needs one more. The transmitted codewords are therefore 10110100 (data + even parity) and 10110101 (data + odd parity), and a receiver running the same count knows the rules instantly: a word claiming even parity whose ones count oddly has suffered an odd number of bit flips; re-request or flag it. Flip exactly one bit of our codeword — say the third, giving 10010100 — and the count falls to three ones: the check fires. Flip two bits and the count returns to even, and the error passes: that blind spot for even numbers of errors is parity’s defining limitation, stated on this page without embarrassment because every stronger code in the family (checksums, Hamming codes with their parity bits woven through the data, CRCs, modern ECC) is a direct answer to it. One bit of redundancy buys detection of one bit of error — and the entire science of error-correcting codes is the art of spending further bits more cleverly.

Where Parity Still Stands Guard

The scheme’s simplicity kept it employed long after stronger codes existed. Serial communication carried parity for decades: classic UART settings (9600 baud, 8 data bits, even parity, 1 stop bit — “9600 8E1” on a spec sheet) append exactly the bit this calculator computes, and legacy industrial and aviation gear still speaks it. ASCII’s seventh bit: the original 7-bit ASCII left the eighth bit of each byte free, and parity was its customary tenant in early storage and transmission. Memory: parity RAM added a ninth bit per byte to flag single-bit errors, and its descendant ECC memory corrects them using Hamming-family codes — parity’s grandchildren run every server on earth. RAID 5’s parity disk is this page’s XOR at block scale: the parity block is chosen so the stripe’s XOR is zero, and a lost disk is rebuilt by XORing the survivors — the same “make the total even” idea wearing a hard hat, sized by this site’s RAID Calculator. Even the check digit family (credit cards’ Luhn algorithm, barcodes) is a cousin: one redundant symbol, computed from the others, catching the commonest accidents. Parity’s own niche within the family is the very short, very cheap check — one bit, one XOR tree, instant verdict — and wherever the cost of an undetected error is “send it again,” it remains the rational amount of protection.

Even, Odd, Mark, Space and the Stuck Bit

Serial standards name four flavours, and the calculator covers the two that carry information. Even and odd parity are the rules above. Mark parity fixes the extra bit at 1 and space parity at 0 — neither checks anything (the bit is constant, so no error changes a count that matters), and both exist as compatibility settings for equipment that expects a bit in that position; meeting them in a manual is meeting history, not integrity. A subtler field lesson is the stuck-at fault: a line or memory cell physically stuck at 0 or 1 defeats naive testing because a carefully chosen data pattern may already match the stuck value — which is why memory tests march patterns of alternating bits (0101…, 1010…) through every cell, guaranteeing each bit is asked to be both values in turn. Parity detects such a fault only when the corrupted word’s count breaks the rule; the march patterns exist to force the corruption into the open. And the connection back to design: for a channel with bit-error rate p, a parity-checked byte of 8 bits goes undetected-bad with probability roughly C(8,2) p² — at p = 10⁻⁴, about 3 × 10⁻⁷ per byte — numbers a system designer compares against the cost of the retransmission or the stronger code. This page gives you the bit; the statistics decide how much company it needs.

From Parity to Hamming: Three Bits That Point

Parity detects and stops; Hamming’s construction shows how a few more bits learn to locate. Place parity bits at positions 1, 2 and 4 of a 7-bit word (the powers of two), data at positions 3, 5, 6, 7, and let each parity bit guard the positions whose binary index contains its own: p1 watches 1, 3, 5, 7; p2 watches 2, 3, 6, 7; p3 watches 4, 5, 6, 7. Encode the data 1011 (positions 3, 5, 6, 7 = 1, 0, 1, 1) with even parity: p1 covers data bits 1, 0, 1 — two ones, already even, so p1 = 0; p2 covers 1, 1, 1 — three ones, so p2 = 1; p3 covers 0, 1, 1 — two, so p3 = 0. The codeword, positions 1–7, is 0110011. Now corrupt any single bit — say position 6 flips to 0. The checks report: p1’s set still even (pass), p2’s set now even when it should be odd (fail), p3’s set odd (fail). Read the failures as a binary number, p3p2p1 = 110 = 6 — the syndrome is the address of the error. Flip it back and the word is healed: that is single-error correction, bought with three redundant bits per four data bits, and it is the direct ancestor of the ECC memory correcting your server’s RAM this second. The distance language unifies the family: parity is a distance-2 code (detects 1), Hamming (7,4) is distance-3 (corrects 1, or detects 2) — and every code since is a negotiation among distance, redundancy and decoding cost that this page’s one bit begins.

Check Digits: Parity’s Cousins in Daily Life

The same philosophy — append a computed symbol, verify at the till — guards numbers that never touch a wire. A payment card’s final digit is a Luhn check: double every second digit (subtracting 9 from two-digit results), sum everything, and a valid number’s total ends in 0. The industry test number 4111 1111 1111 1111 passes with a sum of 30 — try it on paper and watch the check digit (the last 1) earn its place: change any single digit and the sum leaves the multiple-of-ten rail, which is why a mistyped card number is caught by the form before any bank is troubled. Barcodes (mod-10 with weights), ISBNs (mod-11, strong enough to catch transpositions as well as single errors) and bank account validations are the same genus with different arithmetic. None of these correct — like parity, they detect and reject — but deployed at the point of typing, detection is the whole job: the cheapest error is the one refused at the door. Seeing the family resemblance is the takeaway: whether the redundant symbol is a bit, a digit or a RAID block, it is calculated from the data by a public rule, carried alongside it, and checked before trust is extended.

Common Mistakes

Confusing the parity bit with the data’s last bit (it is appended, conventionally at the end or as the byte’s high bit — know your format’s convention). Counting the parity bit in the count that computes it. Expecting parity to correct errors (it detects odd-count flips and locates nothing; correction needs Hamming-style redundancy). Expecting it to catch two-bit errors (it cannot — the count returns to even). And setting a UART to “no parity” against equipment expecting even: the extra bit’s absence shifts the framing and the link speaks garbage, a configuration error masquerading as corruption.

Related Tools

Continue with the RAID Calculator, the CIDR Calculator, the Day of the Week Calculator, or browse the full Other Calculators hub.

Frequently Asked Questions

How is a parity bit calculated?

Count the 1s in the data. For even parity, the parity bit makes the total count even (bit = 1 if the data count is odd, else 0). For odd parity it makes the total odd. 1011010 has four 1s, so its even parity bit is 0 and its odd parity bit is 1.

What errors can parity detect?

Any odd number of bit flips in the word — one, three, five — because each breaks the count rule. Any even number of flips passes undetected, which is parity’s known blind spot and the reason stronger codes exist.

Can parity correct errors?

No. It reports that a word is wrong without any information about which bit flipped. Error correction needs more redundancy — Hamming codes place several parity bits, each checking a different subset of positions, and their combined verdict (the syndrome) points at the bad bit.

Why do serial settings mention parity?

Classic serial links append one parity bit per byte (“9600 8E1” = 9,600 baud, 8 data bits, even parity, 1 stop bit). Both ends must agree on the flavour or the framing itself breaks and the data reads as garbage.

Is RAID 5 parity the same idea?

Yes, at block scale: the parity block makes each stripe’s XOR zero (an even-parity rule across disks), so any single lost block is rebuilt from the rest — the same arithmetic as this calculator’s, with disks for bits.

What are mark and space parity?

Settings where the extra bit is fixed at 1 (mark) or 0 (space). They check nothing — the bit never varies with the data — and survive only as compatibility options in serial equipment.