Two's Complement Calculator
Choose encode or decode and enter a number or a bit string.
A whole number that fits in the bits chosen.
Bits
The width of the word.
Try
Result
You entered
Grouped in fours
Hexadecimal
Read as an unsigned number
Show the work
Two's complement
With bits the leftmost bit is the sign (it is for a negative number), and the range is to . A negative number is stored as .
Flip the bits and add 1
Write the size in bits, flip every bit, then add . This is the same as taking minus the size.
Result
So is in bits.