One's Complement Calculator

Free online One's Complement Calculator. Flip every bit of a binary number to get its one's complement. Supports 4, 8, 16, and 32-bit widths with a step-by-step bit-flip view.

883.5K uses Updated · 2026-05-06 Runs locally · zero upload
AD

How to Use One’s Complement Calculator

The One’s Complement Calculator instantly flips every bit in your binary number. Enter a binary string, choose the bit width you want to work with, and the One’s Complement Calculator shows the original padded value, the complemented result, and a column-by-column flip diagram.

  1. Enter Binary Input - Type a binary number using only 0s and 1s. The calculator filters out any other characters automatically.
  2. Select Bit Width - Choose 4, 8, 16, or 32 bits. Your input is padded with leading zeros to match the selected width.
  3. View the Complement - The One’s Complement Calculator shows the flipped binary value and its decimal equivalent.
  4. Inspect the Step Diagram - Each bit is shown with an arrow indicating the flip from 0→1 or 1→0.

If your input is longer than the selected bit width, the full input length is used as the width.

Formula & Theory - One’s Complement Calculator

The One’s Complement Calculator uses this core formula or rule: a straightforward bit inversion:

One's Complement: flip every bit
  0 → 1
  1 → 0

Example (8-bit):
  Original  : 1 0 1 1 0 0 1 0
  Complement: 0 1 0 0 1 1 0 1
SymbolMeaning
b_iThe i-th bit of the original number
~b_iInverted bit (NOT b_i)
nBit width

For an n-bit number N, the one’s complement is:

$$\bar{N} = (2^n - 1) - N$$

Assumptions and Limits

The One’s Complement Calculator works with unsigned binary strings up to 32 bits. It does not automatically handle signed integers or two’s complement arithmetic. For negative number representation in modern systems, use the two’s complement method instead.

Use Cases for One’s Complement Calculator

The One’s Complement Calculator is useful in several computing and educational contexts:

  • Understanding binary negation - Learn how complement arithmetic works before studying two’s complement.
  • Checksum algorithms - IP (Internet Protocol) and UDP use one’s complement addition for header checksums.
  • Digital logic courses - Visualize bit flipping as part of Boolean algebra and logic design coursework.
  • Historical computing - Early computers (e.g., UNIVAC) used one’s complement to represent negative numbers.
  • Embedded systems - Compute bitwise masks and inverted control patterns for hardware register manipulation.
  • Exam preparation - Practice manual bit-flip calculations and verify answers with the One’s Complement Calculator.

Frequently asked questions about One's Complement Calculator

What is one's complement?

One's complement is obtained by inverting every bit of a binary number: each 0 becomes 1 and each 1 becomes 0. For example, the one's complement of 1010 is 0101.

How is one's complement different from two's complement?

One's complement simply flips all bits. Two's complement flips all bits and then adds 1. Modern computers use two's complement to represent negative integers, but one's complement is still used in some checksum algorithms.

What does the bit width option do?

The bit width pads your input with leading zeros to the selected number of bits before flipping. This ensures you get the full representation at 4, 8, 16, or 32 bits.

Is my data stored?

No. All calculations happen in your browser; nothing is sent to a server.