B2 · How Artificial Intelligence Works: Data and Learning

How Computers Store Information

Computers store all information as numbers written in binary, a system that uses only two digits, 0 and 1. Each 0 or 1 is called a bit, and a group of eight bits is a byte. Letters, colours and sounds are all turned into binary numbers.

10 min Beginner Jump to the activity

What you need: Nothing. This page starts from the beginning, with no programming and no formulas.

Definition

How can a computer store a song, a photo and this sentence using only 0 and 1?

Computers store all information as numbers written in binary, a system that uses only two digits, 0 and 1. Each 0 or 1 is called a bit, and a group of eight bits is a byte. Letters, colours and sounds are all turned into binary numbers.

In simple words

Inside a computer are billions of tiny switches that are either off (0) or on (1). With enough switches you can write any number. Then we agree on meanings: the number 65 can mean the letter A, a group of three numbers can mean a colour, and a long list of numbers can mean a song.

Why it matters

AI learns by working with numbers. Knowing that every photo, word and sound becomes numbers explains how a machine can 'see' or 'hear' at all, and why storage is measured in bytes, megabytes and gigabytes.

How it works

Binary works like the cards in the activity below. Each card is worth double the one to its right: 1, 2, 4, 8, 16. Turn cards face up and add their values to make any number.

UnitSizeRoughly holds
BitOne 0 or 1Yes or no
Byte8 bitsOne letter
Kilobyte (KB)About 1,000 bytesA short message
Megabyte (MB)About 1 million bytesA photo or a song
Gigabyte (GB)About 1 billion bytesA film

Try it yourself

Binary cards

Flip the cards to make each target number. Face up is 1, face down is 0.

Common mistakes

  • Thinking computers understand words directly. Everything is numbers underneath.
  • Mixing up bits and bytes. A byte is eight bits.
  • Thinking binary is a different language for each computer. It's the same 0s and 1s everywhere.

Check yourself

Question 1

1. What does binary use?

Question 2

2. How many bits make a byte?

Question 3

3. With cards worth 16, 8, 4, 2, 1, which cards make 10?

Summary

  • Computers store everything as binary: 0s and 1s.
  • A bit is one 0 or 1; a byte is eight bits.
  • Letters, colours and sounds are all turned into numbers.

Finished reading?

Sources: CS Unplugged: Binary numbers