Home / Learn / Binary vs Decimal

Binary vs Decimal

The two number systems you'll meet most often, compared head to head: what changes between them, what stays the same, and how to convert fluently in both directions.

Side-by-side comparison

BinaryDecimal
Base210
Digits0, 10–9
Place values1, 2, 4, 8, 16…1, 10, 100, 1000…
Built forhardware (2 states)humans (10 fingers)
Example: forty-five10110145
Digits needed~3.3× morecompact

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:

DivisionQuotientRemainder
45 ÷ 2221
22 ÷ 2110
11 ÷ 251
5 ÷ 221
2 ÷ 210
1 ÷ 201

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

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

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.