Two’s complement calculator
See how a signed decimal integer is stored in two’s complement form at 8, 16, 32 or 64 bits. The tool shows the binary pattern, the hexadecimal value, and both the unsigned and signed interpretations of the same bits.
Two’s complement is how nearly every modern CPU represents negative integers: −n is stored as 2^w − n for a width of w bits, which lets addition and subtraction work with a single circuit. Everything runs locally in your browser.