Decimal to Binary: How Computers See Numbers

Computers think in binary. Every photo, song and database row underneath is just 1s and 0s. The conversion is one short algorithm.

Calculators do the heavy lifting, but knowing what is going on underneath is what saves you money — or stress — later. Computers think in binary. Every photo, song and database row underneath is just 1s and 0s. The conversion is one short algorithm.

The method

Divide by 2, keep the remainder, repeat with quotient. Read remainders bottom up. 13 → 6 r1 → 3 r0 → 1 r1 → 0 r1 = 1101.

Powers of 2 to memorise

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024.

Hex shortcut

Hex is base 16 — each hex digit = 4 bits. Easier to read than long binary.

Why it matters

RGB colours, IP addresses, networking subnet masks, low-level programming, file sizes.

Pro tips

  • 1 byte = 8 bits = max value 255 (unsigned).
  • Megabytes vs mebibytes: 1 MB = 1,000,000 bytes (SI), 1 MiB = 1,048,576 bytes (binary). Always check which.

Frequently asked questions

Why use binary? Electronic switches have two states (on/off). Binary maps directly to hardware.

What's a quantum bit? Can be 0, 1, or both — fundamentally different math, currently early-stage commercially.

The math is the easy part. Acting on what it tells you is where the real win lives.

Related