Lesson 3 of 6 About 5 minutes

Everything is ones and zeros

The big idea

A computer only understands two things: on and off. Everything it does, every word, every photo, every song, is built from patterns of just those two states.

Think about a light switch. It only has two positions: on or off. Now imagine a long row of light switches. By choosing which ones are on and which are off, you could make a pattern. That pattern could mean something, if you and a friend agreed ahead of time on what each pattern stands for.

That's exactly how a computer stores everything. Instead of light switches, it uses tiny electronic parts that are either on or off. Off is written as 0. On is written as 1. This system is called binary.

How can 0s and 1s spell a word?

A single 0 or 1 is called a bit. On its own, a bit can't say much. But group eight of them together, and you get a byte, which can represent 256 different patterns. Computers agree on which pattern means which letter, so a byte can stand for a single character, like the letter A.

String enough bytes together, and you can spell an entire word, a whole sentence, or a book. The computer never actually "sees" letters. It only ever sees patterns of on and off, and it translates those patterns into letters for you to read on the screen.

What about pictures and music?

The same idea works for anything a computer stores. A photo is broken into millions of tiny colored dots, and each dot's color is stored as a number, which is stored as binary. A song is broken into thousands of tiny sound measurements each second, also stored as numbers, also stored as binary.

It sounds unbelievable that photos and songs are really just very long strings of 0s and 1s, but that's exactly what's happening every time you look at a picture or listen to music on a device.

Try this

Here's a simple version of binary you can do on paper. Each column below stands for a number: 8, 4, 2, 1. To make any number from 0 to 15, put a 1 under the columns that add up to it, and a 0 under the rest.

  1. Make the number 5. Hint: 4 plus 1 equals 5, so put a 1 under the 4 column and the 1 column, and 0s everywhere else.
  2. Now try making the number 9.
  3. Now try spelling the first letter of your name using this chart: A is 1, B is 2, C is 3, and so on through the alphabet. Write that number in binary using the same four columns.
The number 9 in binary: 1 0 0 1 8421 1 0 0 1
The switch is up (1) for 8 and for 1, giving 8 + 1 = 9.
Words to know
Binary
A way of writing information using only two symbols, 0 and 1, which is how computers store everything.
Bit
The smallest piece of information a computer stores. It's either a 0 or a 1.
Byte
A group of eight bits, treated as one piece of information, often used to represent a single character.
Quick check
What are the only two symbols used in binary?

0 and 1.

Are photos and songs stored as binary too, or just words?

Everything a computer stores, including photos and songs, is stored as binary in the end.

What is a byte made of?

Eight bits grouped together.

What to remember
  • Computers store everything using only two symbols: 0 and 1. This is called binary.
  • A single 0 or 1 is a bit. Eight bits grouped together make a byte.
  • Words, photos and music are all, in the end, just very long patterns of 0s and 1s.