digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen the lab →

Two's complement of -128

The number -128 in 8-bit two's complement is 10000000. You get it by taking the two's complement of 128: write 128 in binary as 10000000, invert every bit to 01111111, then add 1. Applying the two's-complement operation to -128 negates it back to 128 (null).

-128 in 8-bit two's complement10000000

Invert and add 1

Here is how -128 is written in 8-bit two's complement, step by step. You take the two's complement of the magnitude 128:

  1. Write 128 in 8-bit binary: 10000000.
  2. Invert every bit (the one's complement): 01111111.
  3. Add 1: 10000000.

-128 at 4, 8, and 16 bits

Width-128 as a signed numberTwo's complement of -128
4-bit
8-bit10000000
16-bit11111111100000000000000010000000

A dash means -128 (or its negation) is outside that width's signed range: 4-bit two's complement holds -8 to 7, 8-bit holds -128 to 127, and 16-bit holds -32768 to 32767.

Convert any number

Two's complement is how computers store signed integers, so one adder can both add and subtract. Read the full two's complement lesson, or convert any value at 8, 16, or 32 bits with the two's complement calculator.

Want to see two's complement do real work? Open the lab and wire a subtractor from an adder and inverters, or follow the free course from a transistor up to an 8-bit CPU.

Open the two's complement calculator →

Frequently asked

What is the two's complement of -128?

Applying the two's-complement operation to -128 negates it to 128 (null in 8-bit binary). The pattern 10000000 is how -128 itself is stored in 8-bit two's complement.

How do you write -128 in two's complement?

-128 in 8-bit two's complement is 10000000: write 128 as 8-bit binary, invert the bits, and add 1. At 16 bits it is 1111111110000000.

What is -128 in 16-bit two's complement?

-128 in 16-bit two's complement is 1111111110000000. Two's complement sign-extends a shorter value by copying the sign bit to the left, so the value is unchanged from its 8-bit form.