Sign-Magnitude / One’s Complement / Two’s Complement Calculator
Original code / inverse code / two’s complement converter
For positive numbers the original, inverse and two’s complement forms are usually identical; for negative numbers they differ most, and the bit width directly affects the result.
Results
About Sign-Magnitude, One’s and Two’s Complement
This calculator handles online conversion of sign-magnitude, one’s complement and two’s complement, how to find the two’s complement of a negative number, 8-bit and 16-bit two’s complement, and more. Enter a decimal integer to quickly see the representation at different bit widths.
Usage & FAQ
Q: What is the difference between sign-magnitude, one’s and two’s complement?
A: Sign-magnitude keeps the sign bit and the value bits directly; one’s complement inverts the value bits for negative numbers; two’s complement adds 1 to the one’s complement and is the most common way computers store integers.
Q: How do I find the two’s complement of a negative number?
A: Write the sign-magnitude form of the negative number, invert every value bit other than the sign bit to get the one’s complement, then add 1 to get the two’s complement.
Q: Why do 8-bit and 16-bit results differ?
A: Because the bit width differs, the number of binary bits available to represent the value differs, and the leading-bit padding also changes. So the same negative decimal may have different two’s complement representations at 8, 16 and 32 bits.
Q: What is this calculator good for?
A: Studying computer organization, preparing for written tests and interviews, understanding how signed integers are stored, and quickly checking two’s complement results during development.
Related Uses
When studying sign-magnitude, one’s and two’s complement, use the radix converter to cross-check binary, decimal and hexadecimal results, or the encoding converter to view byte representations.