Skip to main content
math

One's Complement Calculator

Calculate the one's complement (bitwise NOT) of a binary number. Invert all bits — 0s become 1s and 1s become 0s.

Reviewed by Chase FloiedUpdated

This free online one's complement calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.

Results

One's Complement (Binary)

213

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the One's Complement Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.

2

Review your inputs

Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The One's Complement Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

Formula Reference

One's Complement Calculator Formula

See calculator inputs for the governing equation

Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.

When to Use This Calculator

  • Use the One's Complement Calculator when you need a quick mathematical result without writing out all the steps manually, saving time on repetitive calculations.
  • Use it to verify hand calculations on tests or assignments and catch arithmetic mistakes.
  • Use it when teaching or explaining mathematical concepts to others, demonstrating how changing inputs affects the result.
  • Use it to explore the behavior of mathematical functions across a range of inputs.

About This Calculator

The One's Complement Calculator is a free mathematical calculation tool for students, educators, and professionals who need quick, reliable results. Calculate the one's complement (bitwise NOT) of a binary number. Invert all bits — 0s become 1s and 1s become 0s. The underlying algorithms implement well-established mathematical formulas and numerical methods. Results are computed instantly in the browser. This tool is useful for learning, verification of hand calculations, and rapid exploration of mathematical relationships. All computation happens locally — no data is sent to a server.

About One's Complement Calculator

The one's complement of a binary number is obtained by flipping every bit: all 0s become 1s and all 1s become 0s. Mathematically, for a w-bit number n, the one's complement is (2^w − 1) − n. One's complement was historically used as a signed number representation (before two's complement became standard) and is still used in networking (Internet checksum, IP header checksum). The one's complement is also the first step in computing the two's complement (one's complement + 1 = two's complement). This calculator computes the one's complement of any integer at your chosen bit width.

The Math Behind It

One's complement inverts every bit: NOT(0) = 1, NOT(1) = 0. For a w-bit number, ~n = (2^w − 1) − n. In one's complement signed representation, negative numbers have all bits flipped from their positive counterpart. This gives two representations of zero: +0 (all 0s) and −0 (all 1s), which complicated arithmetic hardware. The Internet checksum uses one's complement arithmetic: add 16-bit words with end-around carry (carry out of MSB is added back to the LSB). One's complement addition is its own inverse, making it efficient for checksum verification. In modern computing, one's complement is primarily used as a step toward two's complement and in bitwise operations.

Formula Reference

One's Complement

~n = 2^w − 1 − n

Variables: w = bit width, n = input value

Bitwise NOT

Flip every bit: 0 → 1, 1 → 0

Variables: All bits inverted

Worked Examples

Example 1: One's Complement of 42 (8-bit)

Find ~42 in 8 bits.

Step 1:42 in binary = 00101010
Step 2:Flip all bits: 11010101
Step 3:Decimal: 255 − 42 = 213 (unsigned) or −42 (signed one's complement)

~42 = 11010101₂ = 213₁₀ (unsigned)

Common Mistakes & Tips

  • !Confusing one's complement with two's complement — two's complement adds 1 after flipping.
  • !Not specifying bit width — the result depends on how many bits are used.
  • !Assuming one's complement gives negative values — it depends on the interpretation (signed vs. unsigned).

Related Concepts

Used in These Calculators

Calculators that build on or apply the concepts from this page:

Frequently Asked Questions

Why is one's complement not used for signed integers anymore?

One's complement has two representations of zero (+0 and −0), which complicates comparison and arithmetic. Two's complement has a unique zero and simpler addition logic.