Two's Complement Calculator
Two's complement is how a computer stores a negative whole number, by inverting the bits of the magnitude and adding one. Enter a decimal value and a width to get that pattern in binary and hexadecimal, or enter a binary or hex pattern to read it back as a signed value. Widths run from 4 to 64 bits, and every pattern is also shown as an unsigned number. A value too large for its width is not rejected; it wraps the way the hardware would, and the wrap is named.