Bits, Bytes and Binary: Why Everything Is Numbers
Inside a computer, everything is a number. Your photos, your messages, your music and every app you use are stored as long lists of 0s and 1s.
That sounds strange at first. By the end of this lesson it will feel normal, and the rest of the course will make much more sense.
What You'll Learn
- What a bit is and why computers use only 0 and 1
- How bits group into bytes, and what KB, MB, GB and TB mean
- How binary counting works, with no hard math
- How text, colors, photos and sound all become numbers
A bit is one switch
A computer chip contains billions of tiny electronic switches. Each switch can be in one of two states: off or on. We write off as 0 and on as 1.
One switch, holding one 0 or one 1, is called a bit. The word comes from "binary digit".
Why only two states? Because two states are easy to tell apart, even when electricity is a little noisy. A switch is either clearly off or clearly on. That makes computers very reliable. Ten different levels of electricity would be much easier to mix up.
Counting with only 0 and 1
You count in decimal, which uses ten digits (0 to 9). When you run out of digits, you add a new column: 9 becomes 10.
Binary works the same way, but it only has two digits. So you run out fast:
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
| 8 | 1000 |
Each new binary column is worth double the one before it: 1, 2, 4, 8, 16 and so on. The binary number 101 means one 4, no 2, and one 1. That adds up to 5.
You never need to do this by hand. The point is that any whole number can be written with only 0s and 1s. Once you can store numbers, you can store anything you can turn into numbers.
Bits group into bytes
One bit is too small to be useful alone. So computers group bits into sets of 8. A group of 8 bits is a byte.
With 8 bits you can make 256 different patterns, from 00000000 to 11111111. That is enough to store one letter of English text, or one number from 0 to 255.
Bigger sizes are built from bytes:
| Unit | Roughly | Everyday example |
|---|---|---|
| Byte (B) | 8 bits | One letter of text |
| Kilobyte (KB) | 1,000 bytes | A short text message |
| Megabyte (MB) | 1,000 KB | A phone photo or a song |
| Gigabyte (GB) | 1,000 MB | A movie, or your phone's memory |
| Terabyte (TB) | 1,000 GB | A large hard drive |
You may see some tools count 1,024 instead of 1,000 for each step. That is why a "1 TB" drive can show a little less space on your computer. Both ways are in use, and the difference is small.
Bits vs bytes in internet speeds
Watch the letter case. A small b means bits. A capital B means bytes.
Internet speeds are usually given in bits per second, like Mbps (megabits per second). File sizes are given in bytes, like MB. Since one byte is 8 bits, a 100 Mbps connection moves at most about 12.5 MB of data per second.
This is why a download often looks slower than the speed your internet plan promises. Both numbers can be right. They are counting in different units.
How everything becomes numbers
Here is the key idea of the whole lesson. To store something, a computer agrees on a rule that turns it into numbers.
Different kinds of data, one idea: agree on a rule, then store the numbers.
| Criteria | Text | Colors | Photos | Sound |
|---|---|---|---|---|
| The rule | Each character gets a number | Mix red, green and blue light | A grid of tiny colored dots | Measure the sound wave many times a second |
| Stored as | One number per letter | Three numbers, each 0 to 255 | Three color numbers per dot | A long list of loudness numbers |
| Example | A could be 65 | Pure red is 255, 0, 0 | A 12 megapixel photo has 12 million dots | Music is often measured 44,100 times a second |
Text
- The rule
- Each character gets a number
- Stored as
- One number per letter
- Example
- A could be 65
Colors
- The rule
- Mix red, green and blue light
- Stored as
- Three numbers, each 0 to 255
- Example
- Pure red is 255, 0, 0
Photos
- The rule
- A grid of tiny colored dots
- Stored as
- Three color numbers per dot
- Example
- A 12 megapixel photo has 12 million dots
Sound
- The rule
- Measure the sound wave many times a second
- Stored as
- A long list of loudness numbers
- Example
- Music is often measured 44,100 times a second
Text. Every letter, digit, space and emoji has a number. A standard called Unicode gives a number to characters from almost every language in the world, including Hindi, Arabic, Chinese and emoji. That is why your phone can show messages in any script.
Colors. A screen makes colors by mixing red, green and blue light. Each of the three gets a number from 0 to 255. So one color is three numbers. White is 255, 255, 255. Black is 0, 0, 0.
Photos. A photo is a grid of tiny dots called pixels. Each pixel is one color, so three numbers. A photo is a very long list of color numbers.
Sound. A microphone measures how loud the sound wave is, thousands of times every second. Each measurement is a number. Play the numbers back fast enough and you hear the sound again.
Video is many photos shown one after another, plus sound. Many videos show 30 or 60 pictures per second.
Why files can be made smaller
A raw photo would be huge. So computers use compression: clever rules that store the same thing with fewer numbers.
Some compression keeps every detail. A ZIP file works like this. Other compression throws away detail you are unlikely to notice. JPEG photos and most music and video files work this way. That is why a photo sent many times through a chat app can start to look blurry. Detail is lost each time.
The same idea runs AI
AI tools follow this rule too. When you type a question into ChatGPT, your words are first turned into numbers. The AI does math on those numbers and turns the result back into words.
If you want to see how that works, the course How LLMs Actually Work explains tokens, the small chunks of text that AI models turn into numbers.
Try it now
Open your phone's settings and find the storage page. Look at how many GB your photos, videos and apps use. Now you know what that means: billions of bytes, each one a group of 8 switches.
Key Takeaways
- A bit is one switch that is either 0 (off) or 1 (on). Computers use two states because they are easy to tell apart.
- Binary is counting with only 0 and 1. Any whole number can be written this way.
- A byte is 8 bits. KB, MB, GB and TB are each about 1,000 times bigger than the one before.
- Small b is bits (internet speed). Capital B is bytes (file size). One byte is 8 bits.
- Text, colors, photos and sound all become numbers through agreed rules like Unicode and pixels.
- Compression stores the same thing with fewer numbers, sometimes by dropping small details.
Quiz
Up next · Lesson 2 of 6
CPU, Memory and Storage: What Happens When You Open an App
5 min read
1 of 6 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

