Binary to Decimal Converter Formula
Understand the math behind the binary to decimal converter. Each variable explained with a worked example.
Formulas Used
Decimal Value
decimal_val = b7*128 + b6*64 + b5*32 + b4*16 + b3*8 + b2*4 + b1*2 + b0*1Variables
| Variable | Description | Default |
|---|---|---|
b7 | Bit 7 (128s) | 0 |
b6 | Bit 6 (64s) | 0 |
b5 | Bit 5 (32s) | 0 |
b4 | Bit 4 (16s) | 0 |
b3 | Bit 3 (8s) | 1 |
b2 | Bit 2 (4s) | 0 |
b1 | Bit 1 (2s) | 1 |
b0 | Bit 0 (1s) | 0 |
How It Works
How to Convert Binary to Decimal
Method
Each position in a binary number represents a power of 2, starting from 2^0 on the right.
Decimal = b7×128 + b6×64 + b5×32 + b4×16 + b3×8 + b2×4 + b1×2 + b0×1
For example, binary 00001010:
Worked Example
Convert binary 00001010 to decimal.
b7 = 0b6 = 0b5 = 0b4 = 0b3 = 1b2 = 0b1 = 1b0 = 0
- 010×128 + 0×64 + 0×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1
- 02= 0 + 0 + 0 + 0 + 8 + 0 + 2 + 0
- 03= 10
Ready to run the numbers?
Open Binary to Decimal Converter