๐Ÿ“˜ CodingMarble Learn

Data Units and Data Transfer Rate

A bit is one 0 or 1. Eight bits make one byte, enough for one letter. Bigger units climb by 1000: 1 kB = 1000 B, 1 MB = 1000 kB, 1 GB = 1000 MB, 1 TB = 1000 GB. File sizes use bytes (B). Data transfer rate, or speed, uses bits per second (b/s, kbps, Mbps). Because 1 byte = 8 bits, 8 Mbps = 1 MB/s. Download time = file size รท speed, with both in the same unit.

๐ŸŽฌ Step-by-step story

  1. A bit is the smallest piece of data: a lamp that is ON (1) or OFF (0).
  2. Eight bits together make one byte. 8 lamps give 256 patterns, enough for one letter.
  3. Each unit is 1000 times bigger: byte, kilobyte, megabyte, gigabyte.
  4. File sizes use bytes (B). Speed uses bits per second (b/s). 8 Mbps is only 1 MB every second.
  5. Download time = size รท speed. 100 MB at 1 MB/s takes 100 seconds.
  6. Your turn: move the sliders for file size and speed, and check your guess of the time.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

๐Ÿค” Common doubts, cleared

Why 8 bits in a byte, why not 10?

Eight bits give 256 patterns, enough for letters, digits and symbols. Computers settled on 8 because it works well with binary counting.

Is 1 kB 1000 or 1024 bytes?

Both are used. Shops and phone makers use 1000. Some programs use 1024 (a binary number). School questions say which to use, or use 1000.

My internet says 50 but my download shows 6. Is something wrong?

No. 50 is in Mbps (bits). Divide by 8: 50 รท 8 is about 6 MB/s. The same speed, two different units.

Why is real download time longer than my sum?

The sum gives the best case. Waiting time, many users and Wi-Fi weakness slow it down a little.

Do I always divide by 8?

Only when you change bits to bytes. Mbps to MB/s: divide by 8. MB/s to Mbps: multiply by 8.

Bit and byte: the smallest units of data

A computer keeps everything as bits. A bit is a tiny switch with only two states: 0 or 1. Think of a lamp that is off or on.

One bit is too small to hold a letter. So we group 8 bits into 1 byte. A byte can make 28 = 256 different patterns. That is enough for one letter, one digit or one symbol.

Kilobyte, megabyte, gigabyte: the ladder of units

Bytes are small, so we use bigger units. Each step up is 1000 times bigger.

UnitShortSizeExample
ByteB8 bitsone letter
KilobytekB1000 Ba short message
MegabyteMB1000 kBa photo
GigabyteGB1000 MBa movie
TerabyteTB1000 GBa big hard disk

Some programs use 1024 instead of 1000 (because 1024 = 210). The names kibibyte (KiB) and mebibyte (MiB) are used for those. In school questions, use the number the question gives you, or 1000 if it says nothing.

Changing units: going up (B to kB) you divide by 1000. Going down (GB to MB) you multiply by 1000.

Data transfer rate: how fast data moves

Data transfer rate (also called speed or bandwidth) tells how much data moves in one second. It is measured in bits per second: b/s, kbps, Mbps, Gbps.

This is where students get mixed up:

Since 1 byte = 8 bits: speed in MB/s = speed in Mbps รท 8. So 8 Mbps = 1 MB/s, and 80 Mbps = 10 MB/s.

Download time: the formula and a step-by-step method

Time = size รท speed. Both must use the same units.

  1. Write the file size and change it to megabytes (MB).
  2. Write the speed and change it to MB/s (divide Mbps by 8).
  3. Divide: time in seconds = MB รท MB/s.

Example: a 60 MB video on a 24 Mbps link. Speed = 24 รท 8 = 3 MB/s. Time = 60 รท 3 = 20 seconds.

Real downloads are a little slower, because of waiting time and other users on the network.

Try it yourself

In the 3D: go to the last step. First guess the time for 400 MB at 16 Mbps, then move the sliders and check.

At home: look at the size of a photo on your phone (in MB). Then run any speed test app. Divide the Mbps result by 8 and work out how long that photo needs to upload. Then upload it and time it with a clock.

Key formulas and definitions

Worked examples

1. How many bits are in 5 bytes?

1 byte = 8 bits. So 5 ร— 8 = 40 bits.

2. A song file is 4 MB. How many kB is that?

1 MB = 1000 kB. So 4 ร— 1000 = 4000 kB.

3. A phone has 64 GB storage. Each photo is 4 MB. How many photos fit?

64 GB = 64 ร— 1000 = 64 000 MB. Photos = 64 000 รท 4 = 16 000 photos.

4. Internet speed is 40 Mbps. What is this in MB/s?

Divide by 8. 40 รท 8 = 5 MB/s.

5. How long to download a 150 MB app at 12 Mbps?

Speed = 12 รท 8 = 1.5 MB/s. Time = 150 รท 1.5 = 100 seconds (1 min 40 s).

6. A 1.2 GB film is downloaded in 4 minutes. Find the average speed in Mbps.

Size = 1.2 ร— 1000 = 1200 MB. Time = 4 ร— 60 = 240 s. Speed = 1200 รท 240 = 5 MB/s. In Mbps: 5 ร— 8 = 40 Mbps.

Common mistakes

Practice quiz

1. How many bits are in 1 byte?
2. 1 MB equals:
3. Which unit is normally used for internet speed?
4. A speed of 16 Mbps is how many MB/s?
5. Download time is:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the difference between MB and Mbps?

MB is megabytes, the size of a file. Mbps is megabits per second, the speed of a connection. 8 Mbps moves 1 MB each second.

How many bits are in a kilobyte?

1 kB = 1000 bytes = 8000 bits (or 1024 bytes = 8192 bits if the 1024 rule is used).

How do I calculate download time?

Change the speed to MB/s by dividing Mbps by 8, then divide the file size in MB by that speed. The answer is in seconds.

Learn first

Learn next

Related lessons

All Computer Science lessons