One’s Complement Calculator

Quick answer

The one's complement calculator converts a signed decimal integer to one's-complement binary for 4 to 64 bits by inverting the bits, or decodes a one's-complement number back to decimal.

Result
1111 1010
Binary of the absolute value / input
0000 0101
Inverted bits
1111 1010
Decimal value
-5
Steps
Write |-5| in binary (00000101) and flip every bit.

One’s complement represents negative numbers by flipping all bits. It was used in early computers such as the CDC 6600 and survives in the Internet checksum used by IPv4, TCP and UDP.

How to use the One’s Complement Calculator

  1. Number of bits
  2. Conversion
  3. Decimal number
  4. Binary number

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Choose the number of bits and the direction. Note that one’s complement has two zeros: 0000… and 1111…

Formula

Negative x: invert every bit of |x| · range for n bits: −(2ⁿ⁻¹ − 1) to 2ⁿ⁻¹ − 1 (with +0 and −0)

Worked example

Inputs — Number of bits: 8; Conversion: Decimal → one's complement; Decimal number: -5.
Results — Result = 1111 1010; Binary of the absolute value / input = 0000 0101; Inverted bits = 1111 1010; Decimal value = -5; Steps = Write |-5| in binary (00000101) and flip every bit..

Key terms

One's complement
Bitwise inversion of a binary number.

Frequently asked questions

What is −5 in 8-bit one's complement?

1111 1010.

Why are there two zeros?

0000 0000 (+0) and 1111 1111 (−0).

Where is one's complement still used?

In the Internet checksum.

How does it differ from two's complement?

Two's complement adds 1 after inverting, removing the second zero.

Sources

  1. Wolfram MathWorld – Binary
  2. Harvard CS50 – Binary and bitwise operators

Cite this calculator

Speedy Calculator. (2026). One’s Complement Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/ones-complement/