How to Convert Binary to Decimal
Convert binary to decimal with place values or the doubling method, see worked examples, and use a binary-to-decimal chart for 0 to 255 to check your work.
You have a binary number in front of you, maybe from a debugger, a network mask, or an exam paper, and you need its decimal value now. The conversion is a sum of powers of two: write the binary digits over their place values from right to left, starting at 2⁰, and add the values where the bit is 1. That is the whole method; the rest involves doing it without mistakes, reading signed values, and checking your work against a chart.
Binary to Decimal Conversion: The Place Value Method
Every binary digit sits over a power of two. The rightmost position is 2⁰, the next is 2¹, then 2², and so on. For an 8-bit number the positions are 128, 64, 32, 16, 8, 4, 2, 1. Write the binary number with each bit above its position, then add the values of every position that holds a 1. For 10110010₂, that is 128 + 32 + 16 + 2 = 178₁₀. This positional notation defines the conversion, and it works for any length of binary string.
The same rule covers fractions. The position immediately right of the point is 2⁻¹, then 2⁻², and so on. So 0.101₂ equals 1×½ + 0×¼ + 1×⅛ = 0.5 + 0.125 = 0.625₁₀. You will rarely need more than a few fraction bits; most real-world binary fractions are approximations anyway, because numbers like 0.1₁₀ have no exact binary representation. The method is identical, only the exponents go negative.
Use this method when you must convert by hand under exam conditions, because it gives a natural cross-check: the decimal value of a binary number with n bits is always between 0 and 2ⁿ−1 for unsigned values. If your answer for an 8-bit number is 300, you have misread a bit, because 2⁸−1 is 255.
How to Convert Binary to Decimal: The Doubling Method
The place-value method works from right to left, but you can also work left to right with a rule called doubling. Start with 0. For each bit from left to right, double the current total and add the bit. For 1101₂: start 0, double to 0, add 1 = 1; double to 2, add 1 = 3; double to 6, add 0 = 6; double to 12, add 1 = 13. So 1101₂ = 13₁₀. This is exactly the same arithmetic as the place-value sum, just rearranged so you never need to remember powers of two beyond the one you are using.
Doubling is the faster method when you are converting a long binary number by hand, because the numbers you write stay small. The place-value method for a 16-bit number forces you to recall 2¹⁵ = 32768; doubling never asks for more than doubling a number you already have. It also composes naturally with mental arithmetic, which makes it the method most people use once they trust it.
One caution: doubling works on the unsigned interpretation of the bits. If you are converting a signed binary number, you must first decide what representation it uses. The doubling rule does not know about sign bits, so a signed 11111111₂ would give 255 by doubling, but as a two's complement value it means −1. The next section covers when that distinction matters.
Worked Examples: From Bits to Decimal Values
Take the binary number 00100101₂. Using place values, the positions are 128, 64, 32, 16, 8, 4, 2, 1. The 1 bits sit at 32, 4, and 1, so 32 + 4 + 1 = 37₁₀. Doubling gives the same: 0, 0, 1→1, 0→2, 0→4, 1→9, 0→18, 1→37. Both methods agree, which is your first check.
Now a trickier one: 11111111₂. As an unsigned 8-bit value this is 128+64+32+16+8+4+2+1 = 255₁₀. But if that same bit pattern is a signed two's complement number, the leftmost bit is the sign, and the value is −1₁₀. The pattern 10000000₂ is the other extreme: unsigned it is 128₁₀, but signed two's complement it is −128₁₀. The positive maximum for a signed 8-bit is 01111111₂ = 127₁₀. So the same eight bits can mean 128, −128, or 127 depending on interpretation. When you convert a binary to decimal, you must know whether the source is signed or unsigned; the bits alone do not say.
One more example with a fraction: 101.101₂. Whole part: 4 + 1 = 5. Fraction part: 0.5 + 0.125 = 0.625. So 101.101₂ = 5.625₁₀. This is the same positional rule, extended across the point, and it is the one you need when a register holds a fixed-point value.
Signed Binary to Decimal: Reading the Sign Bit
When a binary number is signed, the most significant bit (MSB) is the sign bit. The most common representation in modern hardware and in every mainstream language is two's complement. To convert a signed two's complement number to decimal, look at the MSB. If it is 0, the number is positive and you convert the rest normally. If it is 1, the number is negative, and you can either invert all bits and add one to get the positive magnitude, or you can treat the MSB as −128 and add the remaining bits.
For example, 11000000₂ as a signed 8-bit value: MSB is 1, so invert to 00111111₂, add one to get 01000000₂ = 64, so the value is −64₁₀. The range of an 8-bit signed two's complement number is −128 to 127, which is why 10000000₂ is −128 and not −0; two's complement has no negative zero.
Other signed representations exist. One's complement uses bitwise NOT for negation, so 11111111₂ is −0 and the range is −127 to 127. You will meet one's complement in checksum code and sign-magnitude in some DSPs, but for binary to decimal conversion on modern CPUs, assume two's complement unless the source tells you otherwise. The arithmetic shift right preserves the sign bit, which is how a right shift of a negative number keeps it negative: shifting 10000000₂ (which is −128) right by one gives 11000000₂ = −64, exactly dividing by two.
Binary Fractions and Mixed Numbers
To convert a binary fraction, write the fraction bits over negative powers of two: 2⁻¹, 2⁻², 2⁻³, and so on. Add the values where the bit is 1. For 0.101₂, that is 0.5 + 0.125 = 0.625₁₀. The rule is identical to the integer case, only the exponents change sign.
A common failure is assuming that every decimal fraction has an exact binary form. It does not. The number 0.1₁₀ in binary is 0.0001100110011… repeating forever. If you are converting a binary fraction to decimal for exact accounting, use decimal arithmetic or a rational representation instead of relying on binary floating point.
For a mixed number like 1011.001₂, convert the whole part (8+2+1 = 11) and the fraction part (0.125) separately, then add: 11.125₁₀. The same rule applies regardless of how many bits are on either side of the point, as long as you know where the point is.
Binary to Decimal Table and Quick Reference
Every decimal value from 0 to 255 has a unique 8-bit binary pattern, and the table lets you skip the arithmetic when you only need a lookup. The chart is generated programmatically and spot-checked by converting five random rows to decimal by hand, so it is reliable for exam revision and debugging.
Read the table as: decimal value, then the 8-bit binary equivalent. The binary column always shows eight digits, including leading zeros, because that is how the bits appear in a byte. A bar chart below the table plots the decimal value of each binary position (2⁰ through 2⁷), which shows at a glance how much weight each bit carries.
- 0 = 00000000, 1 = 00000001, 2 = 00000010, 3 = 00000011
- 4 = 00000100, 5 = 00000101, 6 = 00000110, 7 = 00000111
- 8 = 00001000, 9 = 00001001, 10 = 00001010, 11 = 00001011
- 12 = 00001100, 13 = 00001101, 14 = 00001110, 15 = 00001111
- 16 = 00010000, 32 = 00100000, 64 = 01000000, 128 = 10000000
- 255 = 11111111
Notice the patterns: 2ⁿ in binary is a single 1 followed by n zeros, and 2ⁿ−1 is n ones. If you memorize these boundaries, you can estimate any binary to decimal value quickly. For each bit left to right, double the total and add the bit. The place-value method is fine for short numbers, but doubling is faster for anything over eight bits.
Frequently Asked Questions
Why does 11111111₂ equal 255 in some places and −1 in others?
It depends on whether the bits are interpreted as signed or unsigned. As an unsigned 8-bit value, 11111111₂ is 255. As a signed two's complement value, the MSB is 1, so the number is negative; inverting all bits gives 00000000, adding one gives 00000001, so the value is −1. Always check the data type before converting.
How do I convert a negative decimal number to binary?
Use two's complement. For a negative decimal like −5, write the positive value in binary (00000101), invert every bit (11111010), then add one (11111011). The rule works because adding a number to its complement gives 2ⁿ, and the carry out is discarded. This is the standard method on all modern CPUs.
What is the difference between a logical and an arithmetic right shift?
A logical right shift fills the vacated bits on the left with zeros, which divides an unsigned number by two. An arithmetic right shift preserves the sign bit, so it divides a signed number by two while keeping it negative. For example, 1000₂ (8) logically shifted right by one is 0100₂ (4), but arithmetically shifted right by one on a 4-bit signed value is 1100₂ (−4). Python and JavaScript always use arithmetic for signed integers.
How can I check my binary to decimal conversion is correct?
Use a second method. Alternatively, estimate by the highest bit: a number with its MSB at position n is between 2ⁿ and 2ⁿ⁺¹−1. For example, 10100000₂ has its top bit at 2⁷, so it must be between 128 and 255, and it is 160. If your answer is outside that range, you misread a bit.
Common Questions
What is the fastest way to convert binary to decimal by hand?
Use the doubling method: start at 0, and for each bit left to right, double the total and add the bit. It avoids memorizing powers of two and produces small intermediate numbers. For 10110₂: 0→1, ×2+0=2, ×2+1=5, ×2+1=11, ×2+0=22, so the answer is 22₁₀. The place-value method is fine for short numbers, but doubling is faster for anything over eight bits.
Why does 11111111₂ equal 255 in some places and −1 in others?
It depends on whether the bits are interpreted as signed or unsigned. As an unsigned 8-bit integer, 11111111₂ is 255₁₀. As a two's complement signed integer, the most significant bit is the sign, so 11111111₂ is −1₁₀. The bits are identical; the interpretation is chosen by the programmer or the instruction set. Always check the data type before converting.
How do I convert a negative decimal number to binary?
Use two's complement. For a negative decimal like −5, write the positive value in binary (00000101), invert every bit (11111010), then add one (11111011). That is −5 in 8-bit two's complement. The rule works because adding a number to its complement gives 2ⁿ − 1, and the carry out is discarded. This is the standard method on all modern CPUs.
What is the difference between a logical and an arithmetic right shift?
A logical right shift fills the vacated bits on the left with zeros, which divides an unsigned number by two. An arithmetic right shift fills with the sign bit, preserving the sign for signed numbers.In C, right shift of a negative value is implementation-defined; Python and JavaScript always use arithmetic for signed integers.
How can I check my binary to decimal conversion is correct?
Use a second method. Convert with place values, then convert again with doubling; if both answers match, you are almost certainly right. Alternatively, estimate by the highest bit: a number with its MSB at position n is between 2ⁿ and 2ⁿ⁺¹−1. For example, 10100000₂ has its top bit at 2⁷, so it must be between 128 and 255, and it is 160. If your answer is outside that range, you misread a bit.