AP Courses AP Biology AP Biology Units AP Human Geography AP HUG Units AP Computer Science Principles AP CSP Units
Practice Daily Practice Practice by Course Practice by Topic Practice Tests
AP Exam Resources AP Exam Dates Registration Fees Scores & Credit What to Bring
Start Practicing → Login Register →

AP Computer Science Principles · Unit 2 · Data

Bits and Bytes in AP CSP

Unit 2 · Storage · ~7 min read

Bits and bytes are the basic storage units in AP Computer Science Principles Unit 2. A bit is one binary digit, either 0 or 1. A byte is 8 bits.

On this page, you will learn the difference between bits and bytes, how file-size units like KB, MB, and GB work, why Mbps and MB are not the same, and how to avoid common AP CSP storage-unit mistakes.

Updated May 21, 2026Reviewed by APScore5 Editorial TeamAP CSP Unit 2 · Data

Bit vs byte8 bits = 1 byteKB / MB / GBMbps vs MBFile sizeAP-style practice
Step 1Bit vs byte8 bits = 1 byte. Step 2Storage unitsKB, MB, GB. Step 3Mbps vs MBBits vs bytes labels. Step 4PracticeTwelve topic MCQs.
Direct answer

In AP CSP, a bit is one binary digit (0 or 1) and a byte is 8 bits. File sizes use bytes; network speeds often use bits per second—label units before you calculate.

Quick answer

What are bits and bytes in AP CSP?

In AP CSP, a bit is one binary digit: 0 or 1. A byte is a group of 8 bits. Computers represent data using bits, while file sizes are usually measured in bytes or larger byte-based units such as KB, MB, and GB.

In one sentence: A bit is one 0 or 1, and a byte is 8 bits.

Tiny example: If a file contains 80 bits, that equals 10 bytes because 80 ÷ 8 = 10.

Map the full Unit 2 path on the AP CSP Unit 2 Data hub, or review binary numbers first if base-2 place values still feel new.

Definitions

Bit vs byte

The most important rule on this page is simple: 1 byte = 8 bits.

TermMeaningAP CSP Example
BitOne binary digit0 or 1
Byte8 bits01000001
BitsUsed for low-level representation and network speedsMbps
BytesUsed for file size and storageMB, GB
Digital dataData represented with bitstext, images, audio, files

Why does a byte have more capacity than a bit?

A bit has 2 possible values. A byte has 8 bits, so it has 2⁸ possible bit patterns, which equals 256. You do not need to memorize every pattern, but you should remember that a byte stores much more information than a single bit.

AP CSP shortcut: bit = one 0 or 1; byte = 8 bits.

For the base-2 foundation, review Binary Numbers. For place-value sums, use the binary to decimal conversion guide when stems ask you to read small binary values.

Storage

How do KB, MB, and GB relate to bytes?

File sizes are usually measured in bytes or larger byte-based units. AP CSP questions often use approximate values so students can reason about size without difficult arithmetic.

UnitApproximate MeaningCommon Example
Byte8 bitsone small character in simple examples
KBabout 1,000 bytesshort text file
MBabout 1,000,000 bytesphoto, song, or PDF
GBabout 1,000,000,000 bytesvideo or large app

Why file sizes use bytes

Operating systems and apps usually show file size in bytes, KB, MB, or GB because bytes are easier to read than long counts of bits. A 5 MB file is easier to understand than saying about 40 million bits.

AP CSP tip: If the question says file size, expect bytes. If it says network speed, expect bits per second.
Units

Mbps vs MB: the common AP CSP trap

Mbps and MB look similar, but they are not the same. The lowercase b in Mbps means bits. The uppercase B in MB means bytes.

LabelUsually MeansUsed For
bbitindividual binary digit
Bbyte8 bits
Mbpsmegabits per secondinternet speed
MBmegabytesfile size
GBgigabytesstorage size

Simple conversion rule

To compare bits and bytes, use 8 bits = 1 byte. To convert bits to bytes, divide by 8. To convert bytes to bits, multiply by 8.

Examples: 80 bits = 10 bytes. 10 bytes = 80 bits.

Reasoning

AP CSP file-size reasoning

AP CSP may ask students to reason about file size, storage, or transfer time. The goal is usually to check whether you understand the unit, not to do complicated math.

Question ClueWhat to Think
A file is 4 MBFile size is in megabytes
A connection is 40 MbpsSpeed is in megabits per second
A file has 80 bitsDivide by 8 to get 10 bytes
A file has 10 bytesMultiply by 8 to get 80 bits
A photo is larger than a text fileImages usually need more data than plain text

Where compression fits

Compression can reduce file size, but compression is a separate topic. First understand bits and bytes; then study how compression reduces the number of bits needed to store data.

Next, review Data Compression.

Mistakes

Common mistakes about bits and bytes

MistakeCorrection
Thinking bit and byte mean the same thingA byte is 8 bits
Forgetting uppercase B vs lowercase bB usually means bytes; b usually means bits
Using MB for speedInternet speed is often Mbps, not MB
Using Mbps for file sizeFile size is usually MB or GB
Forgetting to divide bits by 8bits ÷ 8 = bytes
Forgetting to multiply bytes by 8bytes × 8 = bits
Thinking KB, MB, and GB are bitsThey usually refer to bytes in file-size contexts
Trying to memorize every storage exampleFocus on unit reasoning

Some classes use ASCII as an example of how text can be stored using bytes, but this page’s main focus is bit vs byte and file-size reasoning.

Exam

How AP CSP tests bits and bytes

AP CSP bits-and-bytes questions usually check whether students can identify the correct unit and convert between bits and bytes.

Question TypeWhat to Do
Define bitOne binary digit, 0 or 1
Define byte8 bits
Convert bits to bytesDivide by 8
Convert bytes to bitsMultiply by 8
Identify file-size unitLook for KB, MB, GB
Identify network-speed unitLook for Mbps or bits per second
Avoid unit trapCheck uppercase B vs lowercase b
AP exam tip: Before calculating, label the unit. Most mistakes happen when students treat megabits and megabytes as the same.

Try the Unit 2 quiz or the 50-question practice set after this page.

Practice

AP CSP practice questions: Bits and bytes

These are short topic checks. For full mixed Unit 2 practice, use the 50-question practice page. Tap an answer to reveal the explanation. Choices shuffle on load.

One bit can store:

Q1

One byte equals:

Q2

How many bytes are in 80 bits?

Q3

How many bits are in 12 bytes?

Q4

Which label usually refers to file size?

Q5

Which label usually refers to internet speed?

Q6

A 5 MB file is best described as:

Q7

Which statement is true?

Q8

A student sees "40 Mbps" for internet speed. What does the lowercase b mean?

Q9

A student sees "40 MB" for a file. What does the uppercase B mean?

Q10

Which conversion is correct?

Q11

Why should students label units before solving AP CSP storage questions?

Q12
Before you leave

What you should be able to do now

Check each skill when you can explain it without looking at notes.

0 of 8 ready

Quick answers

Frequently asked questions

What is a bit in AP CSP?

A bit is one binary digit. It can have one of two values: 0 or 1.

What is a byte in AP CSP?

A byte is a group of 8 bits. Bytes are commonly used to measure file size and storage.

How many bits are in a byte?

There are 8 bits in 1 byte. This is one of the most important AP CSP Unit 2 facts to memorize.

What is the difference between a bit and a byte?

A bit is one 0 or 1. A byte is 8 bits. Bits are often used when talking about low-level representation or network speed, while bytes are commonly used for file size and storage.

How do you convert bits to bytes?

To convert bits to bytes, divide the number of bits by 8. For example, 80 bits equals 10 bytes.

How do you convert bytes to bits?

To convert bytes to bits, multiply the number of bytes by 8. For example, 10 bytes equals 80 bits.

What is the difference between Mbps and MB?

Mbps means megabits per second and is usually used for internet speed. MB means megabytes and is usually used for file size. They are not the same because 1 byte equals 8 bits.

Are KB, MB, and GB bits or bytes?

In file-size contexts, KB, MB, and GB usually refer to byte-based units: kilobytes, megabytes, and gigabytes.

What is the biggest bits-and-bytes mistake in AP CSP?

The biggest mistake is confusing bits and bytes, especially lowercase b for bits and uppercase B for bytes.

What should I study after bits and bytes?

After bits and bytes, study binary-to-decimal conversion and data compression. Those pages build on the idea that digital data is stored using bits and bytes.

Practice Questions Unit 2 Hub