Convert a signed binary value
Choose the source format and intended storage width. Fixed widths add leading zeroes when needed.
Example conversion data
| Bits | Width | Unsigned value | Signed decimal | Explanation |
|---|---|---|---|---|
00001010 | 8 | 10 | 10 | The sign bit is zero. |
01111111 | 8 | 127 | 127 | This is the largest positive eight-bit value. |
10000000 | 8 | 128 | -128 | This is the lowest eight-bit value. |
11110110 | 8 | 246 | -10 | Subtract 256 from the unsigned value. |
FF9C | 16 | 65,436 | -100 | Hexadecimal expands to sixteen bits. |
Formula used
Let n be the selected bit width. First, read the full bit pattern as an unsigned decimal value.
When the sign bit is 0: signed decimal = unsigned decimal.
When the sign bit is 1: signed decimal = unsigned decimal − 2n.
The supported signed range is −2n−1 through 2n−1 − 1. This page calculates decimal strings directly, so wide values remain precise.
How to use this calculator
- Enter a binary pattern or a hexadecimal value.
- Pick the matching input format.
- Select the known storage width, or choose automatic width.
- Use Custom width when your format is uncommon.
- Press Convert to decimal.
- Review the sign bit, normalized pattern, range, and calculation statement.
- Download a CSV file or use the print option for a PDF record.
Understanding signed binary conversion
Signed two’s complement is the usual binary format for signed whole numbers. Computers use it because addition and subtraction follow the same hardware rules. The leftmost bit represents the sign. A zero sign bit means a nonnegative number. A one sign bit means a negative number.
The selected width controls every result. An eight-bit value has eight positions. A sixteen-bit value has sixteen positions. Leading zeroes may change the intended width. Leading ones can also change the signed value. Always choose the width used by the source system.
For a positive input, conversion is direct. Add the decimal weights of all positions containing one. In an eight-bit value, the weights are 128, 64, 32, 16, 8, 4, 2, and 1. The first weight is special when the value is signed. It represents negative 128 instead.
For a negative input, two equivalent methods work. First, calculate the unsigned decimal value. Then subtract two raised to the selected width. For example, 11110110 has unsigned value 246. With eight bits, subtract 256. The signed decimal result is negative 10.
The invert-and-add-one method explains the same result. Invert every bit of a negative value. Add one to the inverted pattern. Convert that magnitude to decimal. Place a minus sign before it. This method is useful when checking calculations by hand.
Input cleanup matters. Binary digits can include spaces, underscores, or grouped separators. They do not alter the stored pattern. A hexadecimal input expands into four binary digits per character. The calculator validates the final bit count. It can pad shorter inputs with leading zeroes when a fixed width is selected.
Overflow is a width problem, not a formatting problem. An n-bit signed value ranges from negative two raised to n minus one through two raised to n minus one minus one. For eight bits, the permitted range is negative 128 through 127. A result outside that range cannot fit without changing the bits.
Use the normalized bits shown by the calculator when documenting values. They reveal the actual sign bit and all leading positions. Save the conversion details for code reviews, device registers, file formats, and networking work. The decimal result is clearer when the source width remains visible.
This calculator supports common word sizes and custom widths. It also accepts hexadecimal source values. Choose hexadecimal only when each character represents four bits. Use binary when every typed character is already a bit. Review the calculation statement before sharing the result.
Compare the signed result with the unsigned result when troubleshooting. They use identical bits but different meanings. This distinction helps diagnose sensor registers, packed messages, and low-level program output. Do not interpret a value as unsigned merely because it looks large. A high leading bit changes its signed meaning. When copying values from a manual, preserve the stated width, radix, and bit order. Those details prevent silent conversion errors. During future technical work.
Frequently asked questions
1. What is signed two’s complement?
It is a binary encoding for positive and negative integers. The highest bit indicates the sign. Negative values use the same addition hardware as positive values, which makes the format common in computing systems.
2. Why does bit width matter?
The same visible digits can represent different values at different widths. For example, 1111 is −1 as four bits. It is 15 if treated as an unsigned four-bit number.
3. How is a negative value converted?
Read the bits as an unsigned value, then subtract 2 raised to the selected width. Another method is to invert every bit, add one, convert the result, and apply a minus sign.
4. What does the leading bit mean?
It is the sign bit. A leading zero means the signed result is nonnegative. A leading one means the signed result is negative. The remaining interpretation still depends on the full width.
5. Can I enter hexadecimal values?
Yes. Select hexadecimal input first. Each hexadecimal character becomes four bits. For example, F6 expands to 11110110, which equals −10 at eight bits.
6. What happens to leading zeroes?
A fixed width preserves the intended number of positions. Shorter inputs receive leading zeroes. This does not change a positive value, but it can be essential for documenting the source format accurately.
7. What is the eight-bit signed range?
Eight-bit signed two’s complement values run from −128 through 127. The pattern 10000000 is −128. The pattern 01111111 is 127.
8. Does grouping alter the result?
No. Grouping merely spaces the normalized bits for easier reading. Groups of four are useful for matching hexadecimal digits. Groups of eight are useful for byte-based documentation.
9. What is overflow in this context?
Overflow occurs when a desired signed number cannot fit within the chosen width. Adding bits changes the available range. Formatting more digits does not create extra storage capacity.
10. Can this calculator handle wide values?
Yes. It supports widths through 256 bits and uses decimal-string arithmetic. That avoids rounding errors that can happen when very large binary values are converted using ordinary floating-point numbers.
11. Should I choose automatic width?
Choose automatic width only when the entered digits are the complete stored pattern. Choose a fixed width when a register, file field, protocol, or programming type defines the value size.