Side-by-side comparison
| Binary | Decimal | |
|---|---|---|
| Base | 2 | 10 |
| Digits | 0, 1 | 0–9 |
| Place values | 1, 2, 4, 8, 16… | 1, 10, 100, 1000… |
| Built for | hardware (2 states) | humans (10 fingers) |
| Example: forty-five | 101101 | 45 |
| Digits needed | ~3.3× more | compact |
The crucial insight: the rules are identical. Both are positional systems where each digit is multiplied by (base ^ position) and summed. The only thing that changes is the base. Master place value once and you can read any base.
Converting binary → decimal
Multiply each bit by its place value, left to right, and add. For 101101:
1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 32 + 0 + 8 + 4 + 0 + 1 = 45.
A handy shortcut: start from the left with a running total of 0. For each bit, double the total, then add the bit. For 101101: 0→1→2→5→11→22→45. Same answer, no place-value table needed.
Converting decimal → binary
Divide by 2 repeatedly, writing down each remainder. Then read the remainders bottom to top. For 45:
| Division | 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 |
Reading remainders upward: 101101. Why does this work? Each division by 2 peels off the lowest bit (the remainder tells you whether the number was odd or even), and the quotient is the remaining higher bits.
When to use which
- Use decimal for anything humans read: prices, measurements, counts, UI labels.
- Use binary when talking to hardware: bit flags, masks, binary protocols, understanding how data is stored.
- Watch out for identical-looking numbers:
1010could be ten (binary) or one-thousand-ten (decimal). In writing, a subscript (1010₂) or prefix (0b1010) removes the ambiguity.
Binary's weakness is length — it needs about 3.3 times as many digits as decimal (because 2^3.3 ≈ 10). That's exactly why hexadecimal exists as a compact middle ground.
Leading zeros and subscripts
Two small conventions prevent most binary/decimal mix-ups. First, leading zeros don't change a value — 00101 is still 5 — but they're often added deliberately to fill a fixed width: 8-bit bytes are written 00000101, not 101, so every value lines up and the width is explicit. When you see binary with leading zeros, it's usually a signal about the data size (8, 16 or 32 bits) rather than decoration.
Second, writers disambiguate with subscripts or prefixes: 1010₂ means binary, 1010₁₀ means decimal, and in code you'll see 0b1010 (binary) versus plain 1010 (decimal). Whenever a number's base isn't obvious from context, mark it — your future self debugging at 2am will thank you.
Try it yourself
Practice both directions with instant results and step-by-step working.
Key takeaways
- Binary (base 2) and decimal (base 10) follow identical place-value rules — only the base differs.
- Binary → decimal: multiply each bit by its place value and sum (or double-and-add left to right).
- Decimal → binary: divide by 2 repeatedly, read remainders bottom-up.
- Binary needs ~3.3× more digits, which is why humans prefer decimal and hex for display.
Frequently asked questions
What is the main difference between binary and decimal?
The base. Binary is base 2 with digits 0–1, built for hardware; decimal is base 10 with digits 0–9, built for humans. Both use identical place-value rules — only the base changes.
How do I convert decimal 45 to binary?
Divide by 2 repeatedly and read the remainders bottom-up: 45→22 r1, 22→11 r0, 11→5 r1, 5→2 r1, 2→1 r0, 1→0 r1. Reading the remainders upward gives 101101.
Is 1010 in binary the same as 1010 in decimal?
No — the digits look identical but mean different things. 1010 in binary is 10 in decimal (8+2); 1010 in decimal is one thousand ten. Context (or a subscript like 1010₂) tells them apart.
Why don't humans just use binary for everything?
Length. Binary needs about 3.3× as many digits as decimal, so everyday numbers become unwieldy — your phone number would be 33 bits long. Decimal is simply more compact for human brains.