Signed binary to decimal converter

The same bits mean different numbers under different signed formats. This tool shows all four readings at once for computer organisation students.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter binary number.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Sign-magnitude: the first bit is the sign and the rest is the size. One's complement: if the first bit is 1, the value is minus the inverted bits. Two's complement: the unsigned value minus 2 to the power n when the first bit is 1.

Example

Inputs: Binary number = 1011. Result: Sign-magnitude: -3.

1011
-3

Limits and caveats

  • The leftmost bit is treated as the sign bit, so type the full width including leading zeros.
  • A result of -0 is shown as is, since sign-magnitude and one's complement both have two zeros.

Questions about this tool

Why does 1011 give three different negatives?

Sign-magnitude reads 011 = 3, so -3. One's complement inverts to 0100, so -4. Two's complement gives 11 minus 16 = -5.

What does -0 mean?

Sign-magnitude and one's complement each have two zeros, such as 1000 and 1111 in 4 bits, one reason two's complement won out.

Which format do computers use for integers?

Two's complement on almost every common processor. Floating-point numbers use a sign-magnitude style sign bit.