How to Calculate Binary to Decimal
Convert binary numbers to decimal.
The Formula
Σ(bᵢ × 2ⁱ)The binary to decimal formula uses the mathematical relationship: Σ(bᵢ × 2ⁱ). Each variable in the formula represents a measurable quantity that affects the final result.
What Each Variable Means
Every value in the binary to decimal formula, what it measures, and the value used in the worked example on this page:
| Variable | Type | Example value |
|---|---|---|
| Number of bits | Input (you provide) | 8 |
| Binary digits (type 0s and 1s, up to 8 bits) | Input (you provide) | 10,101,010 |
| Decimal value | Result (calculated) | — |
| Max value for n bits | Result (calculated) | — |
| Bit count | Result (calculated) | — |
Step-by-Step Method
- 1Write down the values you know: Number of bits, Binary digits (type 0s and 1s, up to 8 bits).
- 2Substitute your known values into the formula: Σ(bᵢ × 2ⁱ).
- 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
- 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
- 5Verify your answer with the interactive Binary to Decimal — it solves the same formula instantly.
Worked Example
Take a concrete case: number of bits = 4, with the other inputs at the typical values from the variables table above. Substituting into the formula gives decimal value = 170, max value for n bits = 15, bit count = 4. These numbers are solved by the same engine that powers the Binary to Decimal calculator, so you can reproduce them exactly by entering the same inputs there.
| Number of bits | Decimal value | Max value for n bits | Bit count |
|---|---|---|---|
| 1 | 170 | 1 | 1 |
| 4 | 170 | 15 | 4 |
| 6 | 170 | 63 | 6 |
| 8 | 170 | 255 | 8 |
| 10 | 170 | 1023 | 10 |
| 20 | 170 | 1048575 | 20 |
| 30 | 170 | 1073741823 | 30 |
How each result changes as number of bits changes, holding the other inputs constant.
Practice Problems
1. 8-bit byte (10101010): Number of bits 8, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010 — work it out, then check the answer.
Answer: With Number of bits 8, Binary digits (type 0s and 1s, up to 8 bits) 10,101,010, the results are Decimal value 170, Max value for n bits 255, Bit count 8.
2. Plug in Number of bits 5, Binary digits (type 0s and 1s, up to 8 bits) 1,010. What is the answer?
Answer: Entering Number of bits 5, Binary digits (type 0s and 1s, up to 8 bits) 1,010 gives Decimal value 10, Max value for n bits 31, Bit count 5.
Frequently Asked Questions
What is the formula for binary to decimal?
The formula is: Σ(bᵢ × 2ⁱ). Convert binary numbers to decimal.
What values do I need to calculate binary to decimal?
You need number of bits, binary digits (type 0s and 1s, up to 8 bits). The calculator produces decimal value, max value for n bits, bit count from those inputs.
What is the binary to decimal when number of bits is 4?
With number of bits = 4, the result is decimal value = 170, max value for n bits = 15, bit count = 4. This is worked through in full in the example on this page.
Related Topics
Use the Interactive Calculator
Skip the manual math — get instant results with our free Binary to Decimal calculator.
