Binary to Decimal Converter — How to Convert Binary to Decimal
A complete guide to binary-to-decimal conversion with the positional notation formula, an 8-bit reference table, step-by-step worked examples, and code in Python, JavaScript, C, and Java.
Try it: Binary to Decimal mini-calculator
Popular Binary to Decimal (Base 2 to Base 10) Reference Table
Below is an instant lookup table answering top search queries like convert from binary to base 10, binary 2 decimal, and binary solver. Click any row to load the exact conversion into the calculator above.
| Binary String (Base 2) | Decimal Value (Base 10) | Power of Two Formula | Meaning / Usage |
|---|---|---|---|
| 1010 | 10 | 8 + 2 = 10 | Standard decimal base number |
| 11111111 | 255 | 2⁸ - 1 = 255 | Maximum 8-bit unsigned integer |
| 10000000 | 128 | 2⁷ = 128 | Midpoint of 8-bit unsigned range |
| 10101010 | 170 | 128 + 32 + 8 + 2 = 170 | Alternating bit test pattern |
Understanding positional notation.
The binary system is a base-2 number system representing values using only two digits: 0 and 1. The decimal system is a base-10 system using ten digits (0-9). If you want to perform the opposite calculation, you can use our dedicated decimal to binary converter.
To convert from binary to decimal, we use the positional notation method. Each digit in a binary number represents a power of 2, starting with 20 on the far right (least significant bit) and increasing by a power of one as you move left. For negative values, see how to convert signed binary to decimal, or learn how to group bits to convert binary to hexadecimal directly.
The conversion formula.
For any binary number with n digits, the conversion formula is:
Where d0 is the rightmost digit, d1 is the second digit from the right, and so on.
Step-by-step binary to decimal conversion examples.
Example 1: Convert 1011 to Decimal
Example 2: Convert 10101 to Decimal
Example 3: Convert 11111111 to Decimal (Max 8-bit value)
Example 4: Convert 10000000 to Decimal
Binary to decimal in code.
print(int("1011", 2)) # 11
print(int("11111111", 2)) # 255
print(int("10000000", 2)) # 128
print(int("10101", 2)) # 21 parseInt("1011", 2); // 11
parseInt("11111111", 2); // 255
parseInt("10000000", 2); // 128
// Or using BigInt for large values:
Number(BigInt("0b" + "11111111")); // 255 #include <stdio.h>
#include <stdlib.h>
int main() {
printf("%ld\n", strtol("1011", NULL, 2)); // 11
printf("%ld\n", strtol("11111111", NULL, 2)); // 255
return 0;
} System.out.println(Integer.parseInt("1011", 2)); // 11
System.out.println(Integer.parseInt("11111111", 2)); // 255
System.out.println(Integer.parseInt("10000000", 2)); // 128 Frequently Asked Questions
How do you convert binary to decimal? ▼
To convert binary to decimal, multiply each binary digit (0 or 1) by 2 raised to the power of its position index (starting at 0 on the far right). Finally, sum all these products to get the decimal equivalent.
What is 11111111 in decimal? ▼
Binary 11111111 = decimal 255. It is the maximum value of an 8-bit unsigned integer: 128+64+32+16+8+4+2+1 = 255 = 2⁸-1.
What is 10000000 in decimal? ▼
Binary 10000000 = decimal 128 (only bit 7 is set: 2⁷ = 128). In 8-bit signed Two's Complement, 10000000 represents -128.
What is the decimal equivalent of binary 1111? ▼
Binary 1111 = decimal 15: (1×2³) + (1×2²) + (1×2¹) + (1×2⁰) = 8+4+2+1 = 15.
How does signed binary to decimal conversion work? ▼
For signed numbers in 8-bit Two's Complement, the MSB (leftmost bit) is the sign bit. If MSB=1, the number is negative. To find its value: invert all bits, add 1, convert to decimal, and prepend a minus sign. See our signed binary to decimal converter.
8-Bit Binary to Decimal Chart
| Binary | Decimal |
|---|---|
| 0000 0001 | 1 |
| 0000 1010 | 10 |
| 0001 0000 | 16 |
| 0100 0000 | 64 |
| 0111 1111 | 127 |
| 1000 0000 | 128 |
| 1010 1010 | 170 |
| 1111 1111 | 255 |
Powers of 2 Reference
| Bit | 2ⁿ | Value |
|---|---|---|
| Bit 0 | 2⁰ | 1 |
| Bit 1 | 2¹ | 2 |
| Bit 2 | 2² | 4 |
| Bit 3 | 2³ | 8 |
| Bit 4 | 2⁴ | 16 |
| Bit 5 | 2⁵ | 32 |
| Bit 6 | 2⁶ | 64 |
| Bit 7 | 2⁷ | 128 |
| Bit 8 | 2⁸ | 256 |
| Bit 9 | 2⁹ | 512 |
| Bit 10 | 2¹⁰ | 1024 |