Table of Contents
Understanding Bits and Bytes
In networking, almost everything is measured in bits and bytes. Before you can understand speeds like Mbps or file sizes like MB, you need to clearly separate these two.
This chapter focuses only on bits and bytes, and how they relate to each other in a networking context.
What Is a Bit?
A bit is the smallest unit of digital information. It can have only two possible values, usually written as 0 or 1.
At the physical and data link layers, bits are what actually move across the wire or through the air. You can think of a bit as a single yes/no answer, or a single light that is either off (0) or on (1).
Because bits are so small, networking speeds are usually described in very large numbers of bits per second.
What Is a Byte?
A byte is a group of 8 bits. This fixed group of 8 is a fundamental building block for how computers store and handle data.
Bytes are used to represent characters, small numbers, or parts of larger values. For example, a single English letter in many encodings is stored in 1 byte.
In memory and storage, sizes are almost always counted in bytes, kilobytes, megabytes, and so on.
A byte always contains 8 bits:
$$1\ \text{byte} = 8\ \text{bits}$$
This rule is universal in modern computing and networking.
Converting Between Bits and Bytes
Because the relationship is fixed, you can convert between bits and bytes using simple multiplication or division.
To convert bytes to bits, multiply by 8.
$$\text{bits} = \text{bytes} \times 8$$
To convert bits to bytes, divide by 8.
$$\text{bytes} = \frac{\text{bits}}{8}$$
Key conversions:
$$1\ \text{byte} = 8\ \text{bits}$$
$$1\ \text{kilobyte (KB)} = 1{,}024\ \text{bytes} = 8{,}192\ \text{bits}$$
$$1\ \text{megabyte (MB)} = 1{,}024\ \text{KB} = 1{,}048{,}576\ \text{bytes}$$
Here we use 1 KB = 1,024 bytes, which is common when talking about storage and memory. You will later see that for network speeds, vendors often use rounded decimal units. That belongs to the Data Units chapter.
Bits and Bytes in Practice
In everyday networking, bits and bytes appear in different contexts.
File sizes are usually in bytes and multiples such as KB, MB, GB. Network link speeds are usually in bits per second and multiples such as Kbps, Mbps, Gbps.
Here are some typical examples of how they relate:
| Item | Approx size in bytes | Approx size in bits |
|---|---|---|
| Single text character | 1 byte | 8 bits |
| Small text email | 10 KB | 80 Kb |
| Simple web page HTML | 100 KB | 800 Kb |
| 3 minute MP3 song | ~3 MB | ~24 Mb |
| 1 GB video file | 1,024 MB | 8,192 Mb |
Notice that for the same amount of data, the value in bits is always 8 times larger than the value in bytes.
Symbols: b vs B
In technical texts and on product labels, bits and bytes are written differently. Confusing these symbols leads to serious misunderstandings about speed or capacity.
By convention, a lowercase b means bit, and an uppercase B means byte.
Always distinguish:
- b = bit
- B = byte
Examples: - Mb = megabit
- MB = megabyte
Here are some common patterns you will see:
| Symbol | Meaning |
|---|---|
| b | bit |
| B | byte |
| Kb | kilobit |
| KB | kilobyte |
| Mb | megabit |
| MB | megabyte |
| Gb | gigabit |
| GB | gigabyte |
The Data Units chapter will go deeper into prefixes like kilo, mega, and giga, and how they are used in networking.
Bits vs Bytes in Speeds and Sizes
In networking, the difference between bits and bytes is central when you compare link speeds with file sizes.
A link speed is typically given in bits per second. A file size is typically given in bytes.
For example, if an internet link is 10 Mbps, that means 10 megabits per second. If a file size is 10 MB, that means 10 megabytes.
To compare them, you must convert one side so that both use the same unit.
For a simple approximation, if you divide the Mbps value by 8, you get the maximum MB per second that link could transfer under ideal conditions.
So:
- 8 Mbps is at most about 1 MB per second.
- 16 Mbps is at most about 2 MB per second.
- 100 Mbps is at most about 12.5 MB per second.
In real networks, the actual transfer rate will be lower than this ideal value. Reasons for that will be covered in other chapters that discuss overhead and throughput.
Why This Distinction Matters in Networking
Understanding bits and bytes is essential for:
- Reading network interface speeds correctly.
- Estimating how long it will take to download or upload a file.
- Interpreting bandwidth graphs and performance tools.
- Understanding protocol headers that are defined in bits and bytes.
If you see a provider advertise 50 Mbps and you expect to download files at 50 MB per second, you will be disappointed. You must always notice whether the unit is bits or bytes.
As you continue through the course, bits and bytes will appear in every layer, from physical signaling in bits to application level file sizes in bytes. Keeping the relationship $1\ \text{byte} = 8\ \text{bits}$ clear in your mind will make all later topics much easier.