Binary to decimal converter

Type a binary number to see its decimal value — or a decimal number to see its binary form — with the powers-of-two expansion worked out below. 0b prefixes, spaces and underscores are accepted.

Try:

Step by step

Type a number above to see the conversion worked out step by step.

How binary to decimal conversion works

Binary is base 2: each position is worth a power of two, doubling from right to left — 1, 2, 4, 8, 16, and so on. Add up the values of the positions holding a 1:

101011₂ = 1×2⁵ + 0×2⁴ + 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 32 + 8 + 2 + 1 = 43₁₀

Decimal to binary works by dividing by 2 repeatedly and reading the remainders from bottom to top — the converter shows those division steps for your number.

First powers of two

2ⁿValue2ⁿValue
2⁰12⁵32
2¹22⁶64
2²42⁷128
2³82⁸256
2⁴162¹⁰1024

Binary values worth recognizing

Round powers of two and "all ones" patterns are the ones that show up in limits and masks:

BinaryDecimalHex
1010100xA
1111150xF
0001 0000160x10
0010 0000320x20
0100 0000640x40
0111 11111270x7F
1000 00001280x80
1111 11112550xFF
0001 0000 00002560x100
0011 1111 11111 0230x3FF
0100 0000 00001 0240x400
1111 1111 1111 111165 5350xFFFF

See the full 0x00–0xFF table

Related tools and guides