🎨 How Computers Store Letters, Pictures and Sounds

5th Grade 💻 Computers & the Internet

We’ve learned that inside a computer there are only 0s and 1s. But on the screen you see words, colorful pictures and emoji, and you hear songs. How does all that fit into numbers? In this lesson we discover the “translation” — and once you get it, you’ll understand why one big photo can take more space than a thousand pages of text.

Free · US Letter · no sign-up
Google Classroom Save to Pinterest Email me

Letters as numbers

To store text, computer makers agreed on a table that gives every character a number. One of the first, ASCII, was set in 1963 and gave a number to every English letter, digit and symbol — for example, capital A is 65. When you type A, the computer actually stores the number 65, in binary. ASCII worked for English, but it had no room for Greek, Russian, Chinese, Hindi or emoji.

So a giant worldwide table called Unicode was created. It gives a number to every character in the world’s writing systems — well over 100,000 characters, including Chinese characters, math symbols and even emoji. Thanks to Unicode, you can send a message in Spanish or Japanese to a phone on the other side of the world, and it shows up correctly. When text turns into gibberish full of strange symbols, it usually means a program read it using “the wrong table.”

Pictures as numbers

A digital picture is a grid of pixels — tiny squares, like a mosaic. For each pixel the computer stores three numbers: how much red, how much green and how much blue it has (RGB). Each number is usually between 0 and 255, which fits in one byte. Three 0s make black, three 255s make white, and 255 red with 0 green and 0 blue makes bright red. Those three numbers can make more than 16 million colors.

A phone camera captures millions of pixels in a single photo — that’s tens of millions of numbers. Resolution is the number of pixels: the more there are, the sharper the picture — and the bigger the file. When you blow up a picture that’s too small, you start to see the squares. That’s called pixelation.

Sounds as numbers

Sound is a wave of vibrations in the air. To record it, a microphone turns the wave into an electrical signal, and the computer measures the height of the wave over and over — tens of thousands of times every second. Each measurement is a number. This is called sampling. When you play the file, the speaker rebuilds the wave from all those numbers, like a connect-the-dots drawing.

The more samples per second, and the more precise each number, the more the recording sounds like the original — but the bigger the file. Video is really lots of pictures (frames) in a row, dozens every second, plus a soundtrack. That’s why videos are the biggest files most people have.

Compression: storing less

If you saved every single pixel and every sample, files would be enormous. So computers use compression. Lossless compression finds repeats — instead of writing “blue” a thousand times for the sky, it writes “blue × 1,000” — and everything comes back exactly. Lossy compression throws away details your eyes or ears can barely notice. Most photo, music and video files work this way.

Lossy compression saves tons of space, but if a file gets compressed again and again — say, a photo passed from phone to phone many times — the quality drops, and you start to see blocky squares and smudges. That’s why a picture that’s been forwarded many times sometimes looks blurry.

Key facts

  • In the ASCII table from 1963, the letter A is the number 65.
  • Unicode gives a number to every character in the world’s writing systems, including emoji.
  • Each pixel is stored as three numbers: red, green and blue (RGB).
  • Three numbers from 0 to 255 can make more than 16 million colors.
  • Sound is stored by sampling: measuring the wave tens of thousands of times a second.

Quick quiz

  1. How does a computer store the letter A?

  2. Why was Unicode created?

  3. What is RGB?

  4. What color do you get when all three numbers are 0?

  5. What is resolution?

  6. What is sampling a sound?

  7. What does lossy compression do?

  8. Why does a photo that’s been forwarded many times look blurry?

💭 Think and talk about it

  1. Draw a heart on graph paper: which squares are red and which are white? That’s exactly how a picture is stored.
  2. Why do you think a song file is so much bigger than a one-page letter?
  3. What problems would happen if every country used a different letter table?

Questions kids ask

How does a computer store text?

Every character has a number in an agreed-upon table. The worldwide table, Unicode, covers the world’s writing systems and emoji, and the numbers are stored in binary.

What is a pixel?

A tiny dot in a digital picture or on a screen. Each pixel is stored as three numbers for red, green and blue.

Why do videos take up so much space?

Because a video is dozens of pictures every second, plus sound. Without compression they’d be much bigger still.

🔎 Ask Thinkapedia another question