Python Programming for Beginners
Lesson 3 of 3 8 min +55 XP

How Computers Count: Binary

Why computers use 1s and 0s.

What you'll learn

  • Explain base-2 (binary)
  • Convert binary to decimal
  • Read place values as powers of two
Light switches all the way down

A row of light switches, each on or off, can spell out any number if you agree what each position means. Computers store everything — numbers, text, photos — as rows of these on/off switches: binary, just 1s and 0s.

Two symbols, any number

Computers store everything as bits — 1s and 0s. Just like our decimal system uses powers of ten, binary uses powers of two. Each place to the left is worth twice the one before: 1, 2, 4, 8, 16, …

00001010 = 8 + 2 = 10
Simulation · Binary counter
1286432168421

binary 00001010 = 10

Toggle the bits on and off and watch the decimal value. Each bit you switch on adds its place value.

Knowledge Check

+15 XP / correct

1. What is the binary number 00000101 in decimal?

2. Each place in binary is worth how much more than the place to its right?