Number base in AP Computer Science Principles

A number base is the foundation of a positional number system that sets how many unique digits exist and what each position is worth. In AP CSP, decimal (base 10) uses digits 0-9 and binary (base 2) uses only 0 and 1, with each place value equal to the base raised to the power of the position.

Verified for the 2027 AP Computer Science Principles examLast updated June 2026

What is number base?

A number base tells you two things about a number system. First, how many unique digits you get to work with. Second, what each position in the number is actually worth. Decimal (base 10) uses the digits 0-9, and binary (base 2) uses only 0 and 1 (EK DAT-1.C.2 and DAT-1.C.3). That's it. Everything else about reading a number in any base follows from one rule: the place value of each position equals the base raised to the power of that position, counting from 0 on the right (EK DAT-1.C.5).

Here's the part that makes binary click. You already do base math every day. When you read 305 in decimal, you're computing 3×10² + 0×10¹ + 5×10⁰. Binary works exactly the same way, just with 2 instead of 10. So binary 101 is 1×2² + 0×2¹ + 1×2⁰ = 5. The base isn't a new kind of math. It's the same positional system you've used since elementary school, with a different number plugged in. The CED makes this explicit (EK DAT-1.C.4): a digit's numeric value is the digit times the place value of its position, no matter the base.

Why number base matters in AP® Computer Science Principles

Number bases live in Topic 2.1 (Binary Numbers) in Unit 2: Data, directly supporting learning objective 2.1.C, which asks you to convert positive integers between binary and decimal and to compare and order binary numbers. EK DAT-1.C.1 states it plainly: number bases, including binary and decimal, are used to represent data. This connects to the bigger Unit 2 idea (2.1.A) that all data on a computing device ultimately bottoms out in bits, which are just binary digits (EK DAT-1.A.2 and DAT-1.A.3). If you don't understand what a base is, binary looks like alien code. Once you do, binary is just counting with two fingers instead of ten. Base understanding also feeds 2.1.B, because the limits of fixed-bit integer representation (like overflow) only make sense if you know how positional binary values grow.

How number base connects across the course

Positional Notation (Unit 2)

Positional notation is the system; the base is the number that powers it. The base sets the place values (base⁰, base¹, base², ...), and positional notation is the rule that a digit's value depends on where it sits. You can't explain one without the other.

Digital Data and Bits (Unit 2)

EK DAT-1.A.2 says computing devices represent everything digitally, with bits at the lowest level. A bit is literally a base-2 digit, so the entire idea of digital data rests on base 2 being the machine's native number system.

Overflow and Integer Representation (Unit 2)

Overflow happens because a fixed number of bits caps the largest base-2 value you can store (EK DAT-1.B.1). With 4 bits, the max is binary 1111, which is 15. Add 1 and the value wraps to 0. Knowing how base-2 place values work is what lets you predict exactly where that ceiling is.

Analog vs. Digital Data (Unit 2)

Analog data is continuous, but computers store discrete digital approximations. Base 2 is the format those approximations get written in, which is why sampling analog signals always ends with binary numbers.

Is number base on the AP® Computer Science Principles exam?

Number bases show up in multiple-choice questions, often in three flavors. First, identification stems, like a question describing a system that uses only digits 0 through 9 and asking which term applies (answer: decimal, base 10). Second, conversion problems where you translate a positive integer between binary and decimal or put several binary numbers in order, which is exactly what LO 2.1.C requires. Third, consequence questions, like a 4-bit variable holding binary 1111 (decimal 15) that wraps to 0 when incremented, where you have to recognize overflow caused by a fixed number of bits. You may also see practical framing, such as why a network tool displays data in hexadecimal instead of raw binary (it's more compact and easier for humans to read, even though the underlying data is still bits). The Create performance task won't ask you to convert bases, but the end-of-course MCQ section definitely will, so practice converting both directions until it's automatic.

Number base vs Positional notation

The base is the ingredient; positional notation is the recipe. Positional notation is the general rule that a digit's value equals the digit times the place value of its position. The base is the specific number (2, 10, 16) that determines those place values and how many digits exist. Decimal and binary use the same positional notation but different bases, which is why converting between them is just re-doing the same place-value math with a different base.

Key things to remember about number base

  • A number base determines how many unique digits a system uses and the value of each position, with binary using base 2 (digits 0 and 1) and decimal using base 10 (digits 0-9).

  • The place value of each position equals the base raised to the power of the position, with positions numbered starting at 0 on the right.

  • Binary and decimal use the exact same positional logic, so binary 101 equals 1×2² + 0×2¹ + 1×2⁰, which is 5 in decimal.

  • A bit is shorthand for binary digit, and a byte is 8 bits, which is why all digital data is ultimately stored in base 2.

  • A fixed number of bits caps the largest base-2 value a variable can hold, so exceeding that cap causes overflow, like 4-bit 1111 wrapping to 0000 when you add 1.

  • On the exam, you need to convert positive integers between base 2 and base 10 in both directions and compare or order binary numbers.

Frequently asked questions about number base

What is a number base in AP Computer Science Principles?

A number base is the foundation of a positional number system that determines how many unique digits exist and what each position is worth. AP CSP focuses on base 2 (binary, digits 0 and 1) and base 10 (decimal, digits 0-9), covered in Topic 2.1 under EK DAT-1.C.1.

Do I need to know hexadecimal for the AP CSP exam?

No, the CED only requires binary and decimal conversions (LO 2.1.C). That said, hexadecimal can appear in question context, like a tool displaying network traffic in hex because it's more compact than binary, and understanding base place values is enough to handle those questions.

How do you convert binary to decimal on the AP CSP exam?

Multiply each bit by its place value (2 raised to the power of its position, starting at position 0 on the right) and add the results. For example, binary 1101 is 1×8 + 1×4 + 0×2 + 1×1, which equals 13.

Is a number base the same as positional notation?

Not quite. Positional notation is the general rule that a digit's value depends on its position, while the base is the specific number (like 2 or 10) that sets the place values and the digit count. Both binary and decimal use positional notation; they just have different bases.

Why do computers use base 2 instead of base 10?

Computing devices represent all data digitally with bits as the lowest-level components (EK DAT-1.A.2), and a bit can only be 0 or 1 (EK DAT-1.A.3). Base 2 matches that two-state hardware reality exactly, which is why binary is the machine's native number system.