Two's complement of 128
The 16-bit two's complement of 128 is 1111111110000000, the pattern for -128. Because 128 is larger than 127 it does not fit in a signed 8-bit byte, so as a positive signed value it needs 16 bits: 0000000010000000.
Invert and add 1
Here is the two's complement of 128 at 16 bits, step by step (invert the bits of 128 and add 1):
- Write 128 in 16-bit binary:
0000000010000000. - Invert every bit (the one's complement):
1111111101111111. - Add 1:
1111111110000000.
128 at 4, 8, and 16 bits
| Width | 128 as a signed number | Two's complement of 128 |
|---|---|---|
| 4-bit | — | — |
| 8-bit | — | 10000000 |
| 16-bit | 0000000010000000 | 1111111110000000 |
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.
Watch out for the 8-bit trap: as an unsigned 8-bit value 128 is 10000000, but read as signed two's complement that same pattern means -128, not 128. That is exactly why 128 needs more than 8 signed bits.
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?
The 16-bit two's complement of 128 is 1111111110000000, the bit pattern for -128. You get it by writing 128 in binary (0000000010000000), inverting every bit (1111111101111111), then adding 1.
How do you write 128 in two's complement?
128 does not fit in signed 8 bits (which stop at 127). In 16-bit two's complement it is 0000000010000000.
What is 128 in 16-bit two's complement?
128 in 16-bit two's complement is 0000000010000000. Two's complement sign-extends a shorter value by copying the sign bit to the left, so the value is unchanged from its 16-bit form.