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.
- 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
Frequently Asked Questions
What is the binary number system?
Binary (base-2) uses only two digits: 0 and 1. It is the fundamental number system used by computers and digital electronics.
Why do computers use binary?
Computers use binary because electronic circuits have two stable states (on/off, high/low voltage), making base-2 the natural representation for digital data.
How do you count in binary?
0, 1, 10, 11, 100, 101, 110, 111, 1000... Each position doubles in value from right to left (1, 2, 4, 8, 16, 32, 64, 128, ...).
Ready to run the numbers?
Open Binary to Decimal Converter