Formula Used
Each binary digit represents a power of two. Positions increase from right to left. Fractional positions use negative powers of two.
Two’s complement subtracts 2n when the sign bit equals one. One’s complement inverts magnitude bits for negative values. Signed magnitude reserves the first bit for the sign.
How to Use
Enter a binary value and choose its interpretation. Select a fixed width when signed meaning matters. Press Calculate or leave real-time conversion enabled.
Use the bit editor to test individual positions. Add a second operand for arithmetic previews. Export the finished result using the available controls.
Worked Examples
| Binary | Unsigned Decimal | 8-bit Signed Decimal | Explanation |
|---|---|---|---|
00000001 | 1 | 1 | Only 2⁰ contributes. |
00001010 | 10 | 10 | 2³ + 2¹ equals 10. |
01111111 | 127 | 127 | The sign bit remains zero. |
10000000 | 128 | -128 | Two’s complement minimum for eight bits. |
11111111 | 255 | -1 | All bits set in two’s complement. |
Common Mistakes
Do not mix decimal digits with a binary input. Confirm the selected width before interpreting signed values. Remember that endianness changes bytes, not individual bit meaning.
Fractional values cannot use ordinary integer complement rules directly. IEEE patterns require exactly sixteen, thirty-two, or sixty-four bits. Leading zeros can change signed interpretation when width changes.
Frequently Asked Questions
What is a bit?
A bit is one binary digit. Its value is zero or one. Multiple bits represent larger numbers and encoded data.
How is binary converted to decimal?
Multiply each bit by its power of two. Add every resulting contribution together. The rightmost integer bit uses power zero.
What is the difference between signed and unsigned?
Unsigned binary uses every bit for magnitude. Signed formats reserve meaning for negative values. The exact range depends on width and format.
Why does 11111111 sometimes equal -1?
Eight-bit two’s complement treats the first bit as negative weight. The remaining positive weights total 127. Therefore the combined value becomes negative one.
What does little-endian mean?
Little-endian stores the least significant byte first. This calculator reverses complete byte groups. It does not reverse bits inside each byte.
Can binary fractions be converted?
Yes, digits after the point use negative powers. The first fractional position represents one half. Later positions represent quarters, eighths, and smaller values.
What is one’s complement?
One’s complement forms negatives by inverting every bit. It contains positive and negative zero patterns. Its negative range differs from two’s complement.
What is IEEE 754?
IEEE 754 encodes floating-point numbers using sign, exponent, and fraction fields. Different widths provide different ranges. Special patterns represent infinities and not-a-number values.
Can very long binary numbers be converted?
Yes, integer conversion uses arbitrary-length BigInt arithmetic. Browser memory still creates practical limits. Extremely wide contribution tables may become large.