Parity bit calculator
1011001 has four ones, so its even parity bit is 0 and its odd parity bit is 1; appending even parity gives 10110010. Compute both bits for a bit string or a byte, append the one you need, or verify a trailing parity bit. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Bits
- 1011001
- Calculation mode
- Append
- Parity
- Even
- Source
- bits
- Bit count
- 7
- Ones count
- 4
- Parity bit
- 0
Parity bits are the oldest single-error detection tool in digital communications: one extra bit that makes the total number of ones even or odd so a flipped data bit is visible at the receiver. Students learning serial protocols, embedded firmware authors wiring UART frames, and automation scripts that assemble or check simple error-detecting codes all need a deterministic answer for a given bit string or byte. This parity bit calculator accepts a string of zeros and ones or a single byte from zero to two hundred fifty-five, computes both even and odd parity bits, appends the bit for the chosen convention, or verifies that a trailing parity bit matches the expected scheme.
What even and odd parity mean for a bit string
A parity bit is a single extra bit chosen so that the total count of one-bits in the combined data-plus-parity word obeys a fixed rule. Under even parity the total number of ones must be even: if the data already has an even count of ones, the parity bit is zero; if the data has an odd count, the parity bit is one. Under odd parity the total must be odd, so the bit is the opposite of the even case.
For the classic classroom example one-zero-one-one-zero-zero-one the data contains four ones, which is already even, so the even parity bit is zero and the odd parity bit is one; appending even parity yields one-zero-one-one-zero-zero-one-zero. Receivers recompute the expected parity over the data bits and compare it with the transmitted trailing bit; a mismatch flags that at least one bit in the frame was inverted or truncated.
Parity does not correct errors and cannot detect every multi-bit corruption, but it is cheap, deterministic, and still appears in UART, simple memory modules, and teaching labs.
What you can do with it
Capture verification and CI gates
Paste analyzer dumps in verify mode to check that the trailing parity bit matches even or odd convention and fail the build when valid is false.
FAQ
How do I compute an even parity bit for a bit string?
Send bits as a 0/1 string (or byte as 0–255) with mode append and parity even.
What is the difference between even and odd parity?
Even parity chooses the bit so the total number of ones is even. Odd parity chooses the opposite bit so the total number of ones is odd. Both values are always returned.
How does verify mode work?
Provide data bits plus a trailing parity bit. The last bit is compared with the expected parity under parity even or odd; valid is true only on a match.
Can I enter a byte instead of a bit string?
Yes. Give a single byte from 0 to 255 and it is expanded to eight bits, most significant bit first, before the parity is worked out. The byte is used when you leave the bit string empty.
Does a parity bit catch every transmission error?
No. It shows that at least one bit was flipped when the recomputed parity does not match, but it cannot spot every corruption of several bits and it never corrects anything. It stays popular because it is simple and light.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/parity-bit \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"bits":"1011001","data":"valor-ejemplo"}'const res = await fetch("https://api.kit.forhosting.com/enc/parity-bit", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"bits": "1011001",
"data": "valor-ejemplo"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/parity-bit",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"bits": "1011001",
"data": "valor-ejemplo"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/parity-bit", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"bits":"1011001","data":"valor-ejemplo"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"bits":"1011001","data":"valor-ejemplo"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/parity-bit", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"bits": "1011001",
"data": "valor-ejemplo"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.parity_bit",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Malformed bit strings—characters other than zero and one after optional separators are stripped—fail with invalid_input instead of inventing a result.
What even and odd parity mean for a bit string
This calculator hard-codes that textbook definition for both conventions so you always see even_parity_bit and odd_parity_bit together with the bit you selected for append or verify. Use append mode when you are building a frame and need the trailer bit; use verify mode when you already have data bits plus a trailing parity bit and need a boolean valid flag.
Input contract, response fields, and malformed strings
The byte field is an integer from zero through two hundred fifty-five and is expanded to an eight-bit most-significant-bit-first string when bits is omitted. Mode defaults to append and may be append or verify; parity defaults to even and may be even or odd. Keep strings under the documented maximum length for browser comfort; the algorithm is a single linear pass over the bits with no network and no randomness. POST a JSON body with either bits or byte. The bits field is a string of zero and one characters; spaces, underscores, colons, hyphens, and commas are stripped before validation, then any remaining non-binary character raises invalid_input with a message that reports a malformed bit string. In append mode the response echoes bits, bit_count, ones_count, the chosen parity_bit, both even_parity_bit and odd_parity_bit, and bits_with_parity with the chosen bit appended. In verify mode the last bit of the input is treated as the received parity bit, data_bits are the preceding bits, expected_parity_bit is recomputed under the chosen scheme, and valid is true only when they match. Alias keys data, bit_string, value, and input are accepted for bits; operation, op, and action alias mode; parity_type and scheme alias parity. Empty bit strings after stripping, verify with fewer than two bits, non-integer bytes outside zero through two hundred fifty-five, and unknown mode or parity values all fail with invalid_input and are not billed.
Where a parity bit calculator earns its keep
Electronics and computer-engineering courses use a parity bit calculator so learners can check homework on even and odd parity without flipping mental counts of ones. Content sites that rank for parity bit calculator gain a live tool whose free path matches the automation path byte-for-byte on the same pure module. Protocol and memory tooling scripts call the API to append even parity before write or to verify frames captured from a logic analyzer, treating valid false as a clear signal to resend or re-read. Pair bits_with_parity with your wire encoder when you need the exact trailer, or assert even_parity_bit and odd_parity_bit side by side in teaching material that compares both conventions.
Integration use cases
Classroom even and odd parity drills
Let students submit a bit string and compare both even_parity_bit and odd_parity_bit against textbook answers, including verify mode for frames that already include a trailer bit.
UART and serial frame assembly
Compute the parity bit for a payload bit string or byte, append it with mode append, and assert bits_with_parity in firmware tests before flashing silicon.
Technical questions
What happens if my bit string is malformed?
After stripping spaces, underscores, colons, hyphens, and commas, any character other than 0 or 1 fails with invalid_input reporting a malformed bit string. Those failures are not billed.
What does the parity bit calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.