Study guide
Bits and Bytes: How Computers Store Data
What bits and bytes are, how binary works, why a kilobyte can mean 1,000 or 1,024 bytes, and how text, images and sound are stored as numbers.
Every photo, song, message and app on your phone is stored as a long string of just two symbols: 0 and 1. That sounds impossibly simple, yet it is the foundation of all modern computing. This guide explains how computers store data, from a single bit to a terabyte, and answers some of the most common computer awareness questions in exams.
What is a bit?
A bit (short for binary digit) is the smallest unit of data. It can have only one of two values: 0 or 1. Inside a computer, these values are represented physically, for example as a low or high voltage in a circuit, or as tiny magnetic regions on a hard disk.
Computers use two states because electronic components can switch between two conditions very quickly and reliably. A single bit can only answer a yes-or-no question, but combining many bits lets us represent almost anything.
Binary numbers
We normally count in base 10 (decimal), using ten digits from 0 to 9. Computers count in base 2 (binary), using only 0 and 1. Each position in a binary number is worth twice the one to its right: 1, 2, 4, 8, 16 and so on.
| Decimal | Binary | Working |
|---|---|---|
| 5 | 101 | 4 + 0 + 1 |
| 10 | 1010 | 8 + 0 + 2 + 0 |
| 255 | 11111111 | 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 |
With n bits you can represent 2 to the power n different values. That is why 8 bits can represent 256 values, from 0 to 255.
Bytes and larger units
A byte is a group of 8 bits and is the basic unit used to measure file sizes and memory. Larger units are built from it:
| Unit | Decimal (SI) meaning | Binary meaning |
|---|---|---|
| Kilobyte (KB) | 1,000 bytes | 1,024 bytes (kibibyte, KiB) |
| Megabyte (MB) | 1,000 KB | 1,024 KiB (mebibyte, MiB) |
| Gigabyte (GB) | 1,000 MB | 1,024 MiB (gibibyte, GiB) |
| Terabyte (TB) | 1,000 GB | 1,024 GiB (tebibyte, TiB) |
This explains why a new "1 TB" hard drive often shows less space on your computer: the drive maker counts in thousands, while some operating systems count in multiples of 1,024. Many school textbooks still teach 1 KB = 1,024 bytes, so read exam questions carefully.
How text, images and sound become numbers
- Text: each character is given a number by a character encoding. In ASCII, the capital letter A is 65. Today the Unicode standard covers characters from almost every writing system, including Devanagari, Gujarati and emoji.
- Images: a picture is divided into tiny dots called pixels. Each pixel's colour is stored as numbers, commonly for its red, green and blue (RGB) components.
- Sound: audio is recorded by measuring the sound wave thousands of times per second and storing each measurement as a number. Music CDs use 44,100 samples per second.
File formats such as JPEG and MP3 use compression to store this information in fewer bytes.
Memory versus storage
RAM (random access memory) holds the data a computer is working on right now. It is fast but volatile, meaning it loses its contents when the power goes off. Storage, such as a solid-state drive (SSD) or hard disk drive (HDD), keeps data permanently but is slower to access. ROM (read-only memory) stores start-up instructions that stay in place without power.
Check your understanding with our computer fundamentals quizzes below.
Put it into practice
Computer Fundamentals Quiz
Computer · Easy · 10 questions
Programming and Networking Basics
Computer · Medium · 10 questions
Internet and Web History
Technology · Medium · 10 questions
More articles
What Is an Algorithm? Programming Basics for Beginners
A beginner-friendly explanation of algorithms: what they are, everyday examples, sequence, selection and loops, flowcharts and pseudocode, and searching and sorting.
The Seven Continents at a Glance
A quick guide to the seven continents: their size, population, famous features and key facts about Asia, Africa, the Americas, Antarctica, Europe and Australia.