What is two's complement?
Two's complement is the standard way computers store negative whole numbers. Positive numbers are written normally in binary. A negative number is written by taking the positive version, flipping every bit and adding 1. The leftmost bit then shows the sign: 1 means negative.
At 8 bits, -1 is 11111111 and -128 is 10000000, while the largest positive number is 127 (01111111). The same bits can mean 255 or -1, depending on whether you read them as unsigned or signed. This tool converts a decimal number to its bits and hex at your chosen width, and reads bit patterns back as a signed value.
How to use the Two's Complement Converter
- Enter a number, or bits such as 0xFF or 0b1010.
- Choose the bit width.
- Read the binary, signed, unsigned and hex forms.
- Check the range for that width.