Report Tool or Give Us Suggestions

Decode Negative Binary

Decode negative binary numbers using various binary representations back to decimal. Supports twos complement, ones complement, sign-magnitude, offset binary, and negabinary.

L ading . . .

What Is Negative Binary Decoding?

Negative binary decoding is the process of converting an encoded binary string back into its original signed decimal integer. Because standard binary can only represent non-negative values, computer systems use special encoding schemes to store negative numbers. This tool supports the five most common representations: Two's Complement, One's Complement, Sign-Magnitude, Offset Binary (Excess-N), and Negabinary (Base -2).

Supported Representations

Two's Complement

Two's complement is the dominant method in modern CPUs. To decode, check the most significant bit (MSB). If it is 0, the number is positive and equals the standard binary value. If the MSB is 1, the number is negative: subtract 2N from the unsigned binary value, where N is the bit width. For example, 11111011 in 8-bit two's complement decodes to 251 − 256 = −5.

One's Complement

In one's complement, negative numbers are represented by inverting all bits of the absolute value. To decode a negative value (MSB = 1): result = −(2N − 1 − unsigned_value). For example, 11111010 in 8-bit one's complement decodes to −(255 − 250) = −5.

Sign-Magnitude

In sign-magnitude encoding, the leftmost bit is the sign bit (0 = positive, 1 = negative) and the remaining bits form the magnitude. To decode, strip the sign bit, convert the remaining bits to decimal, and apply the sign. 10000101 decodes to −5 (sign=1, magnitude=5).

Offset Binary (Excess-N)

Offset binary shifts the entire number range by a fixed offset (default 2N-1). To decode: subtract the offset from the unsigned binary value. Commonly used in floating-point exponent fields. For 8-bit with offset 128: 01111011 → 123 − 128 = −5.

Negabinary (Base −2)

Negabinary uses base −2 instead of base 2. Each bit position i contributes bit × (−2)^i. This allows both positive and negative numbers without a dedicated sign bit. 1111 in negabinary = 1×1 + 1×(−2) + 1×4 + 1×(−8) = 1 − 2 + 4 − 8 = −5.

Frequently Asked Questions

What is the most widely used negative binary representation?

Two's complement is by far the most common representation in modern hardware. It simplifies arithmetic circuits because addition and subtraction work the same way for both positive and negative numbers, and there is only one representation of zero.

What does bit width mean for decoding?

Bit width (N) specifies how many bits were used to encode the number. For two's complement and one's complement, the MSB position determines whether the value is negative. An 8-bit two's complement number ranges from −128 to +127, while a 16-bit version ranges from −32,768 to +32,767.

Does one's complement have two zeros?

Yes. One's complement has two representations of zero: 00000000 (+0) and 11111111 (−0). This is one reason two's complement is preferred over one's complement in practice.

What is the default offset in offset binary encoding?

The default offset is 2N−1, which is half the total range. For 8 bits the offset is 128, for 16 bits it is 32,768. You can enter a custom offset value in the tool if a non-standard offset was used.

Can negabinary represent all integers?

Yes. Every integer (positive, negative, or zero) has a unique negabinary representation, and no explicit sign bit is needed. The base-minus-two system is self-contained and can encode any integer value with enough bits.

logo OnlineMiniTools

OnlineMiniTools.com is your ultimate destination for a wide range of web-based tools, all available for free.

Feel free to reach out with any suggestions or improvements for any tool at admin@onlineminitools.com. We value your feedback and are continuously striving to enhance the tool's functionality.

© 2026 OnlineMiniTools . All rights reserved.

Hosted on Hostinger

v1.10.0