Open up a computer and there is nothing in there that looks like a photograph or a song. There are no little letters stored in tiny boxes. What there is — billions of times over — is a switch. A microscopic switch that can be in one of two states: letting electricity through, or not. On, or off. That is the whole vocabulary the machine has to work with.
It would seem easier to build a machine that could tell apart ten levels of electricity, one for each digit nought to nine. Engineers tried. The trouble is that electricity is noisy — voltages wobble, wires warm up, signals fade along a cable. A machine asked to tell "level six" from "level seven" makes mistakes. But a machine asked only "is there a signal, yes or no?" almost never does. Two states are far apart, and far apart is reliable. So the whole of computing is built on the steadiest question there is: on or off?
We write those two states as numbers — 0 for off and 1 for on. A number system with only two digits is called binary. Everything else in this lesson grows out of that one idea: if you have enough switches, and a way of agreeing what the pattern of 0s and 1s means, you can store anything at all.
We count in tens because we have ten fingers — that is called decimal, or base ten. A computer counts in twos because each digit is a switch — that is binary, or base two. Same idea, different number of digits to play with.
The word bit is short for "binary digit". It was coined by a mathematician named John Tukey in 1947, and the scientist Claude Shannon used it in the paper that founded the whole field of information theory a year later. A single bit is the smallest possible piece of information there is: the answer to one yes-or-no question.
A single 0 or 1 is a bit. One bit on its own can't say much — only "off" or "on", which is two possibilities. But bits gang up. Put bits in a row and each one you add doubles the number of patterns you can make. Two bits give four patterns (00, 01, 10, 11). Three bits give eight. The number you reach for most often is eight bits together, and that group has its own name: a byte.
Why eight? It turned out to be a comfortable size — big enough to hold a single letter, a small number, or one shade of grey, and it has stuck as the standard chunk computers move around. When someone says a file is "two thousand bytes", they mean it is sixteen thousand on-or-off switches, arranged in a particular pattern.
1 bit → 2 patterns. 2 bits → 4. 3 bits → 8. Keep going and a byte of 8 bits reaches 256 patterns. Each switch you add to the row doubles how much the row can say.
A group of four bits — half a byte — has the cheerful official name nibble. Computer engineers really did name it that, as a small joke about a byte. A nibble holds sixteen patterns, which is exactly why programmers like writing numbers in groups of sixteen, a system called hexadecimal.
You already know how place value works in decimal, even if you've never said it aloud. In the number 235, the 2 is worth two hundreds, the 3 is worth three tens, the 5 is worth five ones. Each column to the left is worth ten times the one before. Binary does exactly the same thing — except each column is worth twice the one before, not ten times.
So reading from the right, the columns in a byte are worth: 1, 2, 4, 8, 16, 32, 64, 128. To turn a binary number into an ordinary number, you add up the column values wherever there is a 1. Here is the pattern 00001011 worked out:
Going the other way — turning an ordinary number into binary — you work from the biggest column down. Take 19. The biggest place value that fits is 16, so write a 1 there; that leaves 3. Next is 8 — too big, write 0. Then 4 — too big, write 0. Then 2 — it fits, write 1, leaving 1. Then 1 — it fits, write 1, leaving 0. So 19 in binary is 10011. You can always check: 16 + 2 + 1 = 19.
Tap each card — a few binary patterns and what they come to:
With four fingers and a thumb on one hand, treating each finger as a binary digit, you can count from 0 all the way to 31 on a single hand — far past the usual 5. Add the other hand and you reach 1,023. Each finger is one switch, up or down, holding one bit.
A byte has eight columns, and if all eight hold a 1, you get 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Counting the all-zeros pattern as well, a single byte can hold any whole number from 0 to 255 — that's 256 different values. This is the reason 256 turns up everywhere in computing: it is what one byte can hold.
So a byte can store a number. But how do you store a letter? The answer is wonderfully simple: you agree, in advance, on a number for every letter, and store that number. The oldest agreement of this kind is called ASCII. In ASCII, capital A is the number 65, B is 66, C is 67, and so on. Lower-case a is 97. A space is 32. The word "Hi" is two bytes: 72, then 105.
The ASCII codes for A, B, C run 65, 66, 67 in order, and a, b, c run 97, 98, 99. That tidy ordering is deliberate — it means a computer can sort words into alphabetical order by comparing their numbers.
ASCII only had room for English. Today most computers use a much larger code called Unicode, which has a number for nearly every character in every written language on Earth — Arabic, Chinese, Tamil, ancient Egyptian hieroglyphs — and even every emoji. There are now over 150,000 characters with their own agreed number.
Once you can store numbers, you can store almost anything — you need only a way of turning the thing into numbers first. A digital photograph is broken into a grid of tiny squares called pixels. Each pixel is a single solid colour, and that colour is recorded as three numbers — how much red, how much green, how much blue, each from 0 to 255. Millions of pixels, each with its three numbers, and you have a photograph. Zoom right in and you can see the squares.
Sound works on the same idea, only across time instead of space. A microphone measures how much the air is pushing on it, thousands of times a second, and writes down each measurement as a number. Those measurements are called samples. Play the numbers back through a speaker in the right order, at the right speed, and you hear the original sound. A single second of music can be more than forty thousand numbers — which is why songs are big files.
Letters, photographs, music, video — every kind of file is the same trick underneath. Turn the thing into numbers; store the numbers as bytes; store each byte as a row of on-or-off switches. Agree what the pattern means, and you can store anything.
Bytes pile up fast, so we need shorter words for big piles of them — the same way we say "kilometre" rather than "a thousand metres". Each step up is about a thousand times bigger than the one before. Roughly:
| Unit | Short for | Roughly how much |
|---|---|---|
| bit | a single 0 or 1 | one switch |
| byte (B) | 8 bits | one letter of text |
| kilobyte (KB) | about 1,000 bytes | a short paragraph |
| megabyte (MB) | about 1,000 KB | a minute of music, or a photo |
| gigabyte (GB) | about 1,000 MB | a couple of hours of video |
| terabyte (TB) | about 1,000 GB | a whole laptop's hard drive |
This is the scale behind everything you see on a screen. When your phone says a photo is "3 MB", that's roughly three million bytes — twenty-four million on-or-off switches — every one of them set precisely to hold that one picture. When you next see a file size, you'll know what it is really counting.
A capital B means bytes; a small b means bits. So "100 MB" (megabytes) is eight times more than "100 Mb" (megabits). Internet speeds are usually given in bits, which is why a "100 Mb" connection downloads a 100 MB file in about eight seconds, not one.
Click the bits — each one is worth double the one to its right. Watch the total change as you flip them, then take on the little challenge underneath.
Why 0 to 255? Each of the eight switches doubles the one before it (1, 2, 4, 8, 16, 32, 64, 128). All off gives 0; all on gives 128+64+32+16+8+4+2+1 = 255. That is 256 different patterns in total — 256 values from 0 up to 255. This is how every number, letter and colour inside a computer is really just a pattern of on and off.
You've worked through bits, bytes and place values on paper. Now watch the same idea in motion. As you watch, listen for two things you already know: that every kind of data is stored as numbers, and that every number is stored as a row of on-or-off switches.
Fresh one. Turn the binary number 1010 into an ordinary number, using the place values 8 4 2 1.
Fresh one. Turn the ordinary number 13 into binary, using place values 8 4 2 1.
Imagine explaining it to someone who has never thought about it. Start with the letter on the screen and follow it all the way down to the switches. Three or four sentences is plenty. Try to use, in your own way, the words ASCII, number, byte and bit — and show the order things happen in.
strong You kept the chain in the right order — letter, then its ASCII number, then the byte, then the row of bits. That order is the whole point, and you held onto it the whole way down. The line about the switches being "either on or off, nothing in between" is the heart of it.
try this One sentence does two jobs at once — it names the number and the byte in the same breath, which makes it move a little fast. Give the byte its own short sentence: eight bits, in one group. Slower here reads clearer.
to add You could close with the leap that makes it land: the same trick stores a whole photograph, only with millions of these patterns instead of one. That sentence turns a description into an idea.
Sit down with Dad for any of these. They show where binary, code and computers came from, and the people behind them. Heavier titles flagged for a chat first.
You learned why computers use binary — two states, far apart and reliable. You met the bit and the byte, counted in twos with place values, and turned numbers both ways. You saw how letters, pictures and sound all become numbers, and you learned the words from bit to gigabyte. Next time you see a file size, you'll know what every one of those switches is doing. Florence, this is computing.