CalcUnit Logo

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:

VariableTypeExample value
Number of bitsInput (you provide)8
Binary digits (type 0s and 1s, up to 8 bits)Input (you provide)10,101,010
Decimal valueResult (calculated)—
Max value for n bitsResult (calculated)—
Bit countResult (calculated)—

Step-by-Step Method

  1. 1Write down the values you know: Number of bits, Binary digits (type 0s and 1s, up to 8 bits).
  2. 2Substitute your known values into the formula: Σ(bᵢ × 2ⁱ).
  3. 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
  4. 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
  5. 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 bitsDecimal valueMax value for n bitsBit count
117011
4170154
6170636
81702558
10170102310
20170104857520
30170107374182330

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

binarydecimalnumber system

Use the Interactive Calculator

Skip the manual math — get instant results with our free Binary to Decimal calculator.

Open Calculator

Related Calculators