Lessons › coding and computer science · taught by Leo
How computers store data: bits, bytes, and pixels
Learn how computers store data as bit patterns, how bytes encode meaning, and how pixels make digital images.
Learn this with Leo, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.appPixels and bits are tiny switches
Computers store data by using tiny on/off choices. That is the big idea: everything gets turned into bits.
A bit is the smallest unit of data. It can only be one of two states.
Bits become patterns
A single bit is not very useful by itself. A group of bits makes a pattern that can stand for a letter, a number, a color, or a sound.
Think of bits like a row of tiny light switches. Different on/off patterns mean different things.
So the computer is not storing the thing itself. It is storing a code for the thing.
Predict: what is a bit?
Which is the best description of a bit?
- A tiny unit that is either 0 or 1
- A whole file of data
- A picture on the screen
Show answer
A tiny unit that is either 0 or 1: Yes. A bit is the smallest data unit, and it has only two states.
A byte is 8 bits
Most data is stored in groups. A very common group is 8 bits, called a byte.
Eight bits give more patterns, so they can represent many more symbols than one bit alone.
Quick check: next step
If a computer needs to store more than two choices, what should it do?
- Use more bits in a group
- Use only one bit
- Erase the old pattern
Show answer
Use more bits in a group: Correct. More bits together make more possible patterns.
How a byte makes codes
Here is one example. The pattern 01000001 is just a byte.
That pattern can be assigned a number, like 65, and then a letter, like A.
The key move is encoding. The computer stores a pattern, and people agree on what the pattern means.
Why storage needs codes
Different kinds of data all end up as patterns of bits. The meaning comes from the code the computer uses.
Text, images, music, and videos all become bits in the end.
The code tells the computer how to read those bits back into something meaningful.
Quick check: what is stored?
What does a computer actually store?
- The pattern of bits
- The idea in your head
- The meaning without a code
Show answer
The pattern of bits: Yes. The machine stores bit patterns, and the code gives them meaning.
Pictures are stored in pixels
A picture is stored as many tiny dots called pixels. Each pixel has a bit pattern for its color.
So a photo is not one big image inside the computer. It is a grid of color codes.
File size means more bits
More detail usually means more bits. More bits usually means a bigger file.
That is why high-quality images and videos take more storage.
Your turn: choose the pattern
A computer wants to store a symbol. Which choice is most like what it stores?
- A pattern of 0s and 1s
- A paper drawing of the symbol
- A sound made by the symbol
Show answer
A pattern of 0s and 1s: Good. The computer stores the bit pattern, not the paper or the sound.
Storage recap checklist
Use this checklist: first, data becomes bits.
Next, bits group into bytes. Then codes give the patterns meaning. Finally, many patterns make files.