Bits, Bytes, KB, MB, GB — Computer Memory Units Explained
Understand computer memory units from bits to terabytes. Learn binary vs decimal prefixes, conversion formulas, and real-world storage examples.
Introduction
Every file on your computer, every photo on your phone, and every web page you load is stored as a sequence of binary digits. Understanding memory units — from the tiny bit to the massive terabyte — is fundamental knowledge for any computer science student or IT professional.
This guide explains the hierarchy of memory units, clears up the confusing difference between binary and decimal prefixes, and gives real-world context for each size.
The Bit — Smallest Unit
A bit (binary digit) is a single 0 or 1. It represents one yes/no, on/off, true/false decision. All digital data is built from bits.
A byte = 8 bits. One byte can represent 256 different values (2⁸ = 256), enough for one ASCII character.
Memory Unit Hierarchy
Binary Prefixes (Powers of 1024)
| Unit | Abbreviation | Size | Exact Value |
|---|---|---|---|
| Byte | B | 8 bits | 8 bits |
| Kilobyte | KB | 1,024 bytes | 2¹⁰ bytes |
| Megabyte | MB | 1,024 KB | 2²⁰ bytes |
| Gigabyte | GB | 1,024 MB | 2³⁰ bytes |
| Terabyte | TB | 1,024 GB | 2⁴⁰ bytes |
Decimal Prefixes (Powers of 1000)
Hard drive manufacturers and network speeds use decimal (SI) prefixes:
| Unit | Size (decimal) | Difference from binary |
|---|---|---|
| 1 KB (SI) | 1,000 bytes | 2.4% less than binary KB |
| 1 MB (SI) | 1,000,000 bytes | 4.9% less |
| 1 GB (SI) | 1,000,000,000 bytes | 7.4% less |
| 1 TB (SI) | 1,000,000,000,000 bytes | 9.9% less |
This is why a “500 GB” hard drive shows ~465 GB in your operating system — the drive uses decimal measurement, but your OS uses binary.
Binary vs Decimal: Why the Confusion?
Historically, computer scientists used KB/MB/GB with binary meanings (1024-based). Storage manufacturers used the same abbreviations with decimal meanings (1000-based). To resolve this, IEC introduced distinct binary prefixes:
| Binary (IEC) | Symbol | Decimal (SI) | Symbol |
|---|---|---|---|
| Kibibyte | KiB | Kilobyte | KB |
| Mebibyte | MiB | Megabyte | MB |
| Gibibyte | GiB | Gigabyte | GB |
| Tebibyte | TiB | Terabyte | TB |
In practice, most people still say “GB” for both. Context determines which meaning applies.
Conversion Formulas
Bits to Bytes: divide by 8 Bytes to KB: divide by 1024 (binary) or 1000 (decimal) KB to MB: divide by 1024 MB to GB: divide by 1024
Example: How many bytes in 4 GB?
4 GB (binary) = 4 × 1024 × 1024 × 1024 = 4,294,967,296 bytes 4 GB (decimal) = 4 × 1000 × 1000 × 1000 = 4,000,000,000 bytes
Real-World Examples
| Item | Approximate Size |
|---|---|
| One character (ASCII) | 1 byte |
| One page of text | ~2 KB |
| MP3 song (4 min) | ~4 MB |
| Smartphone photo | ~3–5 MB |
| HD movie (2 hrs) | ~4–5 GB |
| Windows 11 install | ~64 GB |
| Modern SSD | 256 GB – 2 TB |
Network Speeds: Bits vs Bytes
Internet speeds are measured in bits per second (bps, Mbps, Gbps), NOT bytes:
- 100 Mbps connection = 100 megabits/second = ~12.5 MB/second
- To convert: divide Mbps by 8 to get MB/s
This is why downloading a 100 MB file on a “100 Mbps” connection takes about 8 seconds, not 1 second.
Common Mistakes
- Confusing bits and bytes — 1 byte = 8 bits, not the same thing
- Using 1000 when you mean 1024 — OS uses binary (1024), drives use decimal (1000)
- Mixing network bits with storage bytes — Download speed in Mbps ÷ 8 = MB/s actual transfer
- Assuming “free” storage matches label — OS, system files, and formatting overhead reduce usable space
Frequently Asked Questions
Why is 1 KB equal to 1024 bytes and not 1000?
Because computers use binary (base 2). 2¹⁰ = 1024, which is the closest power of 2 to 1000. Computer memory is naturally organized in powers of 2.
How many bytes in 1 GB?
In binary: 1 GB = 1,073,741,824 bytes (1024³). In decimal: 1 GB = 1,000,000,000 bytes (1000³). Your OS typically uses binary.
Why does my 1 TB drive show only 931 GB?
The manufacturer measures in decimal (1 TB = 1,000,000,000,000 bytes), but your OS displays in binary (÷ 1024³ = 931.3 GiB). No storage is “missing.”
What is the difference between RAM and storage?
RAM (volatile) loses data when powered off and is faster. Storage (SSD/HDD, non-volatile) keeps data permanently but is slower. Both are measured in bytes.
How much storage does one WhatsApp message use?
A text message uses about 1–2 KB. A photo message uses 100–500 KB (compressed). A voice note uses about 5–15 KB per second.
Related Calculators
Related Articles
Share this article
Learn Faster with Numverto
Explore free number system converters, binary tools, EMI calculators, GST calculators, and educational guides.
About Numverto
Numverto Editorial Team
Numverto publishes educational content about number systems, computer science concepts, binary arithmetic, financial calculations, EMI formulas, GST calculations, and practical learning resources for students and professionals.
Article Metadata
Tags: binary, computer science, memory, storage
Last Updated: June 2026
Related Calculators
Related Articles
19 June 2026
Why 0.1 + 0.2 Doesn't Equal 0.3 — Floating Point Errors Explained
Understand why computers produce floating point precision errors, how IEEE 754 representation causes rounding, and practical ways to handle it in code.
Read article →17 June 2026
What is 1's Complement and 2's Complement in Binary?
Learn 1's complement and 2's complement with simple explanations, step-by-step examples, and practice problems for BCA/BTech exams.
Read article →15 June 2026
How to Convert Decimal to Binary — Easy Method with Examples
Learn the repeated division method to convert decimal numbers to binary. Step-by-step examples, practice problems, and a free online converter tool.
Read article →