Binary to Signed Integer Converter

Convert a binary bit pattern into a signed decimal integer using two's complement. Choose the bit width, calculate the signed and unsigned values, and see how the result is determined.

Convert Binary to Signed Decimal

Enter only 0 and 1. Spaces and underscores are allowed as visual separators.

A fixed width defines which bit is the sign bit. Shorter inputs are padded with zeros on the left.

Changes the display, not the calculation.

Signed decimal result
-5
Binary pattern
Unsigned decimal value
Bit width
Sign bit
Signed integer range
Conversion rule

Conversion steps

    Quick examples:

    How to Convert Binary to a Signed Integer

    A signed binary integer can represent positive numbers, zero, and negative numbers. Most modern computer systems use two's complement to represent signed integers. The interpretation depends on the number of bits in the pattern.

    Two's complement conversion formula

    First, interpret the entire bit pattern as an unsigned integer, U. For a pattern with N bits, the signed value is:

    If the first bit is 0: signed value = U.
    If the first bit is 1: signed value = U − 2N.

    The leftmost bit is the sign bit. When it is 0, the value is nonnegative. When it is 1, the two's complement interpretation produces a negative value.

    Example: Convert 11111011 to a signed integer

    1. The input has 8 bits, so N = 8.
    2. The unsigned value of 11111011 is 251.
    3. The first bit is 1, so interpret the pattern as negative.
    4. Calculate 251 − 28 = 251 − 256 = −5.

    Therefore, 11111011 represents −5 as an 8-bit signed integer.

    Signed integer ranges by bit width

    Bit width Minimum signed value Maximum signed value
    4 bits-87
    8 bits-128127
    16 bits-32,76832,767
    32 bits-2,147,483,6482,147,483,647
    64 bits-9,223,372,036,854,775,8089,223,372,036,854,775,807

    For an N-bit two's complement integer, the minimum is −2N−1 and the maximum is 2N−1 − 1. This is why bit width matters when converting a binary pattern.

    Frequently Asked Questions

    What is a signed binary integer?

    A signed binary integer is a binary value interpreted as a number that may be positive, zero, or negative. Its bit width and encoding determine its decimal meaning.

    Why can the same binary number have two decimal values?

    The bit pattern 11111111 represents 255 as an unsigned 8-bit integer, but it represents −1 as an 8-bit two's complement integer. The bits are identical; only the interpretation differs.

    Does the bit width change the result?

    Yes. The width determines the sign bit and the power of two used in the conversion formula. Select the width that matches the original data or hardware representation.

    Can I convert 32-bit and 64-bit values?

    Yes. This tool supports input widths up to 64 bits and uses JavaScript BigInt for integer arithmetic, avoiding the precision limitations of ordinary JavaScript numbers for large integers.

    Is this converter free?

    Yes. Conversion happens locally in your browser, with no account required and no form submission to a server.

    Related Binary and Number System Tools