Guide

How to convert binary to decimal step by step

Convert a binary integer to decimal by adding powers of two, with a fully worked example and an exact reverse check.

by Tools in a Tab · Published on · Updated

Short answer

To convert a binary integer to decimal, number its positions from zero starting at the right. Multiply each bit by 2 raised to its position and add the results. A 0 bit contributes nothing; every 1 bit contributes the matching power of two.

This shortcut selects Binary input in the existing converter. Enter your bits or choose Load binary example to check 101101 → 45; no prefix is needed in that mode. Confirm the input format before converting.

Example: convert 101101 to decimal

Break down the six positions:

Bit Position Place value Contribution
1 5 2⁵ 32
0 4 2⁴ 0
1 3 2³ 8
1 2 2² 4
0 1 2¹ 0
1 0 2⁰ 1
101101₂ = 32 + 8 + 4 + 1 = 45₁₀

Paste 101101 in the converter opened in binary mode to verify the decimal result 45. When opening the converter without this shortcut, select Binary or add the 0b prefix: automatic detection treats unprefixed digits as decimal.

An accumulating method for long values

You can also scan from left to right. At each step, multiply the previous result by two and add the new bit:

1 → 2 → 5 → 11 → 22 → 45

This is equivalent to summing powers. It avoids writing a wide table and maps naturally to processing a string of bits.

Leading zeros, signs, and two’s complement

Leading zeros do not affect the value: 00101101 is still decimal 45. An explicit sign applies to the whole number, so mathematical -101101₂ means -45₁₀.

Do not automatically interpret the first bit as a sign. The pattern 11111111 is unsigned decimal 255, but a protocol may define it as -1 using 8-bit two’s complement. Without that width and signed convention, there is no single negative interpretation.

Common mistakes and a reverse check

  • Starting positions at 1; the rightmost digit always has weight 2⁰ = 1.
  • Accepting a digit other than 0 or 1.
  • Dropping an internal zero and shifting every bit that follows it.
  • Using floating-point arithmetic for integers beyond a language’s exact range.

Reverse check: recover the bits from 45

Repeatedly divide the decimal integer by two, keeping both the integer quotient and the remainder. Stop when the quotient reaches zero:

Division Integer quotient Remainder
45 ÷ 2 22 1
22 ÷ 2 11 0
11 ÷ 2 5 1
5 ÷ 2 2 1
2 ÷ 2 1 0
1 ÷ 2 0 1

Read the remainders from bottom to top: 101101. This independently checks the earlier result. Reading top to bottom would produce 101101 in this particular example too, because its bits happen to be a palindrome; use the exercise below to check that you understand the direction.

Practice: convert 11001010 to decimal, then check your answer

The unsigned result is 202: 128 + 64 + 8 + 2. Dividing 202 by two repeatedly gives remainders 0, 1, 0, 1, 0, 0, 1, 1. Read them backwards to recover 11001010, not 01010011 (decimal 83).

To verify with the tool, use 0b11001010 in automatic mode, or select binary and enter 11001010. An unprefixed number in automatic mode is decimal; it is not guessed to be binary just because it contains only zeros and ones. The converter handles integers, not binary fractions, and does not apply an implicit two’s-complement width.

The tool’s exact large-integer operations use the BigInt representation defined by ECMAScript.