Sign-Magnitude Converter
Enter an integer and bit width to convert to sign-magnitude binary.
Result
How it is calculated
For a bit width w, the leftmost bit is the sign (0 for positive or zero, 1 for negative) and the other w − 1 bits hold the absolute value in plain binary, padded with leading zeros. So binary = sign bit + binary(|value|). The value must fit: |value| ≤ 2w−1 − 1, so an 8-bit field covers −127 to 127 and a 4-bit field −7 to 7. The value must be a whole number, and the width a whole number from 2 to 63; if you leave the width empty it is 8. A number that is too large for the width, or a fraction, gives no result. Sign-magnitude has both +0 and −0, but the tool always writes zero with a 0 sign bit, so typing −0 gives 00000000.
Worked example
Convert −18 to 8-bit sign-magnitude. The number is negative, so the sign bit is 1. The magnitude is 18, which is 10010 in binary; padded to the 7 remaining bits that is 0010010. Putting them together gives 10010010, with sign bit 1 and magnitude 18. For comparison, +18 would be 00010010: only the first bit changes, whereas in two's complement −18 would be 11101110.
Common mistakes
- Expecting 8 bits to reach −128. Sign-magnitude spends one bit on the sign, so the range is −127 to 127; 128 is too large and gives no result.
- Choosing a width that is too small. −4 in 3 bits would need a magnitude of 100 in only two bits, so there is no answer; widen the field.
- Mixing it up with two's complement. In sign-magnitude only the first bit differs between +18 and −18; there is no inversion and no adding one.
- Looking for −0. The tool writes zero as all zeros, so −0 cannot be shown.
- Typing a binary pattern or a fraction in the value box. The value is a whole decimal number such as -18: 10010 is read as ten thousand and ten, which does not fit in 8 bits, and 3.5 is not a whole number.
About this calculator
Sign-magnitude is one of the earliest schemes computers used to represent signed integers in binary: the leftmost bit is a dedicated sign bit (0 for positive, 1 for negative), and the remaining bits store the number's absolute value directly, unlike two's complement where negative numbers are encoded by inverting and adding one.
Sign-magnitude is simple to understand and easy to convert to and from decimal by hand, which is why it's still widely taught as the first step in binary number representation — but it has real drawbacks, like having two representations of zero (+0 and −0) and needing separate addition/subtraction logic, which is why almost all modern hardware uses two's complement instead. Computer science students and instructors use converters like this to build intuition for how signed binary representations work before moving on to two's complement.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
This tool only encodes, from a decimal number to bits; it does not decode a bit pattern back into a value. To read a pattern yourself, take the first bit as the sign and treat the rest as a plain binary number. That shows an oddity: 10000000 in 8 bits would mean negative zero, a pattern this converter never produces because zero is always written with a 0 sign bit. Which other encodings, such as one's complement, would you like to see added?