Code Literacy

Unit 0 · What a computer actually does

Why 8 bits make 256 values, not 8

Bits work together, like digits in a number. Each extra bit doubles the number of patterns, so 8 bits give 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256 patterns, numbered 0 to 255.

The mix-up

What people often think

“Each switch stores one value, so 8 switches store 8 values.”

What the tutor says

Switches work together, like digits in a number. Every added switch doubles the patterns, so 8 switches make 256.

How it works

One switch has two patterns: off and on. Add a second switch and each of those two patterns can pair with the new switch off or on, which makes four. A third switch doubles that again to eight. The count never grows by two at a time; it doubles.

That is why a byte, eight bits, can hold any whole number from 0 to 255. The top number is 255 rather than 256 because all eight switches off is a pattern too, and it means zero. Counting 0, 1, 2 and so on up to 255 uses all 256 patterns.

Position matters as much as count. Reading right to left, the switches are worth 1, 2, 4, 8, 16, 32, 64 and 128. The same switches flipped into mirror order make a different number, in the same way that 31 is not 13.

An example

What worksExample
switch value:  128  64  32  16   8   4   2   1
pattern:         0   0   0   0   1   1   0   1

8 + 4 + 1 = 13
Thirteen in binary: start with the biggest switch that fits, then fill in with smaller ones.

Close cousins of this mix-up

The tutor watches for these in the same lesson.

  • “Each switch adds two more patterns.”

    Each switch doubles the patterns, it does not add two. Eight doublings is 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256.

  • “The biggest number is the same as the number of patterns.”

    All switches off is a pattern too: it means 0. Counting 0 through 255 gives 256 patterns.

Practise it with a tutor watching

Bits and switches

Turn a row of on and off switches into a number and a letter.

15 minutes See it Build it Break it Say it
Start the lesson

Free with an account. The first two units need no account.

© 2026 webfaCeMEdia. Code Literacy™ is a trademark of webfaCeMEdia.