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 .
Binary form of a non-negative number
A number that is or more is written in ordinary binary and padded with zeros on the left to bits.
Result
So is in bits.