Binary Numbers

💻 Computer Science Years 7–11 Foundation

How computers count using only 0 and 1, and how to convert between denary and 8-bit binary.

Open this lesson, with practice and a printable worksheet →

Deep down, a computer is a vast collection of switches, each either off or on. There is no "maybe" and no "a bit on". With only these two states, every photo, song, message and game must be built from just two symbols: 0 and 1. This is binary, and once you can read it, you can see how the machine really thinks.

Why this matters: Every other topic in this strand — hexadecimal, text, images, sound, compression — rests on binary. Master converting between ordinary (denary) numbers and 8-bit binary now, and the rest of computer science stops feeling like magic.
128643216 8421 0001 1001 16 + 8 + 1 = 25
The 8-bit place-value table. Add the headings above every 1.

Denary — the counting you already know

100s10s1s247200 + 40 + 7 = 247
Denary: each column is 10× the one to its right (247).

The everyday numbers you use are denary (base 10), because each column is worth ten times the one to its right: units, tens, hundreds, thousands. We use ten digits (0–9) because humans have ten fingers. A computer has, in effect, two fingers — off and on — so it counts in base 2.

Binary place values

In binary each column is worth twice the one to its right. Reading from the right they are 1, 2, 4, 8, 16, 32, 64, 128. Eight of these columns make one byte. Each single 0 or 1 is called a bit (short for binary digit). Think of it like packing a suitcase using only fixed-size blocks — 128, 64, 32 and so on — and you may use each block once.

Place value1286432168421
Bit00011001

Denary to binary

Start: 100128? too big → 064 fits → 1  100 − 64 = 3632 fits → 1  36 − 32 = 44 fits → 1  4 − 4 = 0Result: 0110 0100  (64 + 32 + 4 = 100)
Subtract each place value that fits; write 1, else 0.

Work left to right along the headings. Ask of each: "Does it fit into what's left?" If yes, write 1 and subtract it; if no, write 0 and move on.

Worked example — write 100 in 8-bit binary.
Start with 100. 128? Too big → 0. 64? Fits, 100 − 64 = 36 → 1. 32? Fits, 36 − 32 = 4 → 1. 16? No → 0. 8? No → 0. 4? Fits, 4 − 4 = 0 → 1. 2? No → 0. 1? No → 0.
Reading the bits: 0110 0100. Check: 64 + 32 + 4 = 100. ✓

Binary to denary

The reverse is easier: write the headings above the bits, then add up the values sitting above every 1. For 0100 1101 that is 64 + 8 + 4 + 1 = 77.

Common mistake: forgetting to pad to 8 bits. The number 5 is 101 in pure binary, but as a byte it must be written 0000 0101 — three leading zeros. In an exam, an 8-bit answer always needs exactly eight digits.
101→000001013 bits8-bit bytepad with leading 0s
Pad short numbers to a full 8-bit byte: 5 = 00000101.

Tip: memorise the eight place values 128 64 32 16 8 4 2 1 like a times-table. Once they are automatic, every conversion in this whole strand becomes fast and reliable.

Get the printable worksheet →
← Databases & SQL → Binary Arithmetic & Shifts
← Sasta Basta home All subjects