Ones Complement Calculator
Enter a binary number to flip its bits and get the one’s complement.
Result
How it is calculated
The one's complement of a binary number is made by inverting every bit: each 0 becomes 1 and each 1 becomes 0. The tool takes the digits exactly as typed, so the width is the number of characters you enter, and leading zeros are kept and flipped. It returns the flipped string, the bit count, and the decimal value of the original number, Σ bi × 2i, where bi is the bit at position i counted from the right. The decimal figure is computed with exact digit arithmetic, so even a 67-bit input of all ones shows 147,573,952,589,676,412,927. For an n-bit input the complement equals (2n − 1) − value. The input may contain only 0 and 1 and be at most 2048 digits long: spaces, a 0b prefix, other digits or an empty field give no result.
Worked example
Take the 8-bit number 00101100. Its decimal value is 32 + 8 + 4 = 44. Flip each bit in turn: 0→1, 0→1, 1→0, 0→1, 1→0, 1→0, 0→1, 0→1, which gives 11010011. Check with the formula: (28 − 1) − 44 = 255 − 44 = 211, and 11010011 in binary is 128 + 64 + 16 + 2 + 1 = 211. So the complement is 11010011, with 8 bits, from an original of decimal 44.
Common mistakes
- Confusing one's complement with two's complement. Two's complement is the one's complement plus 1, so the two give different answers for every number.
- Dropping the leading zeros. 00101100 and 101100 are different widths, and their complements, 11010011 and 010011, are different too.
- Typing a prefix or separators such as 0b1011 or 1011 0010. Only the digits 0 and 1 are accepted, so remove them first or there is no result.
- Entering a decimal number or hexadecimal digits. The input is read as binary only, so a value like 44 returns no result.
- Treating the output as the negative of the number in everyday arithmetic. In a signed one's-complement system it represents the negative, but the tool only flips bits and does not interpret the sign.
About this calculator
The one's complement of a binary number is found by flipping every bit within a fixed width — every 0 becomes a 1 and every 1 becomes a 0. For example, the one's complement of the 8-bit value 00101100 is 11010011. This is different from two's complement, which is the one's complement plus 1, and which is what almost all modern processors actually use to represent negative numbers.
Older computer architectures, including some early mainframes and minicomputers, used one's complement directly to represent signed integers, which has the quirk of producing two different bit patterns for zero (positive zero and negative zero). One's complement arithmetic survives today mainly in the Internet checksum algorithm defined in RFC 1071, which computes IP, TCP and UDP header checksums using one's-complement addition specifically because it has useful properties for detecting bit errors and wraps around cleanly.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments