Maths & numbers

One’s complement within a fixed width calculator

Invert each position within the selected word width and preserve leading zeros.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Invert each position within the selected word width and preserve leading zeros.

THE FORMULAFlip each bit using (2ʷ−1)−n

A worked example

00000101 becomes 11111010 in eight bits.

Good to know

The word must fit the selected width.

Read the result

Invert each position within the selected word width and preserve leading zeros.

The primary result is labeled “Inverted word”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

The word must fit the selected width.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

00000101 becomes 11111010 in eight bits.

Which rule does this calculator apply?

Flip each bit using (2ʷ−1)−n

Find your calculator

Start typing to explore the library.