AP Networking • IPv4 Subnetting

How Many Hosts Per Subnet?

Calculate IPv4 host capacity from CIDR prefixes, distinguish total addresses from traditional usable hosts, solve reverse-capacity problems, and make better subnet-sizing decisions with growth and infrastructure included.

Independent AP Networking resource • Updated 2026-09-10 • Includes 24 free digital flashcards
Subnet rule: start with host bits, calculate total addresses, then subtract network and broadcast only when the traditional LAN model applies.
Practice with Flashcards
Core model

Host capacity comes directly from the number of host bits

IPv4 addresses contain 32 bits. A CIDR prefix tells you how many of those bits describe the network. The remaining bits are available for addresses inside that subnet. Once you know the number of host bits, you can determine the total block size and, for traditional LAN subnet questions, the number of ordinary host assignments.

Host-count reasoning chain: Prefix → Host Bits → Total Addresses → Network/Broadcast Boundaries → Traditional Usable Hosts → Capacity Requirement → Headroom.
Formula

Traditional usable hosts = 2^(32 − prefix) − 2

If the prefix is /26, then 32 − 26 = 6 host bits. Six bits create 2^6 = 64 possible addresses. In the traditional model, one address identifies the subnet itself and one is the broadcast address, leaving 62 ordinary host assignments.

/26 32 - 26 = 6 host bits 2^6 = 64 total addresses 64 - 2 = 62 traditional usable hosts

The subtraction is not a magic rule. It reflects the traditional roles of the all-zero and all-one host-bit patterns.

Common host counts

Memorize the pattern, not isolated numbers

PrefixHost bitsTotal addressesTraditional usable hosts
/248256254
/257128126
/2666462
/2753230
/2841614
/29386
/30242

Swipe horizontally to see the complete table.

Why subtract two

The boundary addresses have special traditional meanings

All host bits = 0

Identifies the network address itself.

All host bits = 1

Identifies the traditional directed broadcast address.

Everything between

Forms the ordinary usable host range.

For a /28, four host bits provide 16 total patterns. The first pattern is the network address, the last is broadcast, and the 14 in between are traditional host assignments.

Block-size intuition

Every one-bit increase in prefix length halves the block size

A /24 has 256 total addresses. Move to /25 and the block becomes 128. /26 becomes 64, then /27 becomes 32. This halving pattern is faster to use mentally than rebuilding every power of two from scratch.

/24 = 256 total /25 = 128 total /26 = 64 total /27 = 32 total /28 = 16 total /29 = 8 total /30 = 4 total
Reverse problem

Find the smallest prefix that can satisfy a host requirement

Instead of starting with a prefix, start with the required host count and find the smallest number of host bits for which 2^h − 2 is at least the requirement.

NeedToo smallFirst fitPrefix
12 hosts/29 = 6/28 = 14/28
20 hosts/28 = 14/27 = 30/27
50 hosts/27 = 30/26 = 62/26
100 hosts/26 = 62/25 = 126/25

Swipe horizontally to see the reverse-capacity table.

Capacity vs. headroom

Mathematically fitting does not always mean operationally sensible

If exactly 62 hosts are required, a /26 technically fits 62 traditional usable addresses. But that leaves no room for a gateway, printer, access point, switch management IP, reservation, spare device, or future growth if those are part of the same addressing requirement.

Design rule: calculate the mathematical minimum first, then check infrastructure and growth before choosing the final subnet.
DHCP capacity

Usable host count and DHCP pool size are not the same thing

A /26 may provide 62 traditional usable addresses, but the DHCP server may offer far fewer because some addresses are reserved for infrastructure or excluded from dynamic assignment.

Subnet: 192.168.40.0/26 Usable: .1 through .62 Gateway: .1 Infrastructure: .2-.10 Reservations: .11-.20 DHCP pool: .21-.62 DHCP pool size = 42 addresses —not 62

This distinction matters in capacity planning and DHCP-scope exhaustion troubleshooting.

Worked case 1

A /27 is too small for 50 devices even though 32 sounds close

A /27 has 5 host bits. That creates 32 total addresses, but only 30 traditional usable host addresses. A requirement for 50 devices therefore cannot fit.

The next larger block is /26 with 64 total and 62 usable, so /26 is the smallest traditional subnet that satisfies 50 hosts.

Worked case 2

A /28 fits 12 users but may not fit the whole department

Twelve laptops fit inside a /28 because it provides 14 traditional usable addresses. But if the same subnet also needs a gateway, printer, access point, and two management addresses, the true requirement becomes 17 devices.

Now /28 is too small and /27 is the first practical fit. The lesson is to count all addresses that must exist on the subnet, not only end users.

Worked case 3

A /25 supports 126 usable hosts, but only 100 may be available to DHCP

Suppose .1 is the gateway, .2-.20 are infrastructure, .21-.26 are reservations, and the administrator limits dynamic leases to .27-.126. The subnet has 126 traditional host addresses, but the DHCP pool has only 100 addresses.

This is why “How many hosts can the subnet hold?” and “How many DHCP clients can lease?” are different questions.

Worked case 4

A /30 provides exactly two traditional host addresses

A /30 contains four total addresses: one network, two ordinary host assignments, and one broadcast. This made /30 common historically for point-to-point links because two endpoints need addresses.

Modern point-to-point designs may use /31 under the relevant standards, so the traditional −2 rule should not be applied blindly outside the intended question context.

Worked case 5

Choosing /26 for 60 current hosts leaves almost no growth room

A /26 supports 62 traditional usable hosts. If 60 are already needed, only two addresses remain—and those may already be consumed by infrastructure.

A larger subnet may be justified if growth is expected, but the design decision should also consider broadcast-domain size, segmentation, DHCP, gateway configuration, and security boundaries.

Network boundary example

Host count is easier when you understand the subnet's address range

Take 192.168.10.64/26. A /26 has 64 total addresses, so this block runs from .64 through .127.

Network: 192.168.10.64 First host: 192.168.10.65 Last host: 192.168.10.126 Broadcast: 192.168.10.127 Usable hosts: 62

The host-count formula and the address-boundary calculation should agree. If they do not, one of the calculations is wrong.

Prefix-to-mask connection

The prefix tells you which bits belong to the network

A /26 means 26 network bits and 6 host bits. In dotted-decimal notation, that corresponds to 255.255.255.192. You do not need the mask to calculate host count if the CIDR prefix is already given, but understanding the connection helps with broader subnetting problems.

/26 11111111.11111111.11111111.11000000 255 .255 .255 .192 6 zero bits = 6 host bits
Mental math

Know the powers of two that appear constantly in subnetting

2² = 4

/30 total block size

2³ = 8

/29 total block size

2⁴ = 16

/28 total block size

2⁵ = 32

/27 total block size

2⁶ = 64

/26 total block size

2⁷ = 128

/25 total block size

Special cases

/31 and /32 are reminders that context matters

The traditional formula assumes a multi-host LAN model with distinct network and broadcast addresses. Point-to-point IPv4 networks can use /31 under modern standards, and /32 represents a single host route/address.

Exam discipline: use the traditional −2 rule when the question is clearly about ordinary LAN subnet capacity, but understand why exceptions exist.
Exam wording

“Total addresses” and “usable host addresses” are not interchangeable

Question wording/28 answer
How many total addresses are in the subnet?16
How many traditional usable host addresses?14
How many bits are available for hosts?4
What is the block size?16 addresses

Swipe horizontally to see the wording table.

Differential mistakes

Most host-count errors come from one of four reasoning failures

MistakeWhy it failsFix
Using prefix length as host bits/26 does not mean 26 host bitsCompute 32 − prefix
Forgetting network/broadcastReturns total, not traditional usableSubtract 2 when appropriate
Choosing /27 for 50 hosts30 usable is too smallMove to /26
Ignoring infrastructureUser count understates real demandCount every address requirement

Swipe horizontally to see the mistake table.

Capacity planning lab

Choose a subnet for 45 users plus infrastructure and 20% growth

Suppose a department has 45 user devices, one gateway, two printers, three access points, and four switch-management addresses. That is 55 current addresses. Add approximately 20% growth and the design target becomes about 66 addresses.

Current: 45 users +1 gateway +2 printers +3 APs +4 switch management =55 addresses 20% growth ≈ 11 Target ≈ 66 /26 usable = 62 → too small /25 usable = 126 → fits

This is a better design answer than choosing /26 merely because 45 users fit.

Subnet choice is not only arithmetic

A larger subnet solves capacity but may affect design boundaries

Increasing subnet size provides more addresses, but it can also change broadcast-domain scale, DHCP design, gateway configuration, segmentation, security policy, and documentation. Capacity is one design requirement among several.

For exam questions, state the host-count result first, then connect it to the broader network requirement if the prompt asks for design justification.

AP response model

Show the arithmetic and the decision

Prefix: identify the CIDR length.

Host bits: 32 − prefix.

Total addresses: 2^(host bits).

Traditional usable: subtract network and broadcast when appropriate.

Requirement: compare usable count to needed devices.

Headroom: consider infrastructure and growth.

★ Addressing Practice • How Many Hosts Per Subnet?

A five-minute warm-up for How Many Hosts Per Subnet?

Tomorrow’s opening question can pick up where this page leaves off: have students explain where the addresses come from and what they would check when a device cannot connect. The 300 Bell Ringers give you short questions and teacher answers you can use without preparing a new starter each morning.

300 AP Networking Bell Ringers
$74.99
BUY TEACHER PACK → See what is included in the 300 Bell Ringers →
Instant Access • Full-Year Teacher Resource
Boundary arithmetic

Host capacity and subnet boundaries should agree with each other

Host-count arithmetic becomes much stronger when you connect it to the actual address range. A /27 contains 32 total addresses, so its blocks advance in increments of 32 in the final octet when the subnet lies within a /24. If one block starts at .64, the next starts at .96. That means the .64/27 block spans .64 through .95.

192.168.50.64/27 Block size: 32 Network: .64 First host: .65 Last host: .94 Broadcast: .95 Total = 32 Traditional usable = 30

This cross-check catches mistakes. If your host-count math says /27 has 30 usable addresses but your listed range contains 31 hosts, the boundary calculation is wrong.

Subnet growth ladder

Move one prefix step at a time when a requirement no longer fits

Because each shorter prefix doubles the total block size, capacity planning follows a predictable ladder. If /28 is too small, /27 doubles total addresses from 16 to 32. If /27 is too small, /26 doubles again to 64.

Addressing & Subnetting Lab • 120 Missions

Let students try How Many Hosts Per Subnet? for themselves

Reading the explanation is a start. In the browser simulator, students work through a broken network, choose what to test and see whether their fix worked. It gives them another chance to use what they learned about How Many Hosts Per Subnet?.

AP Networking Browser Troubleshooting Simulator
$29.99
120 Missions • 60 Failure Patterns • Offline Copy
GET THE SIMULATOR → See all 120 missions & features
Current fitNext larger subnetUsable increase
/30 = 2 usable/29 = 6 usable+4
/29 = 6 usable/28 = 14 usable+8
/28 = 14 usable/27 = 30 usable+16
/27 = 30 usable/26 = 62 usable+32
/26 = 62 usable/25 = 126 usable+64

Swipe horizontally to see the growth ladder.

Requirement precision

Count address consumers, not just people

A classroom with 24 students does not necessarily need only 24 host addresses. The same subnet may also include a teacher workstation, printer, AP management address, switch management address, gateway, display controller, lab server, and temporary devices.

For capacity questions, write the requirement explicitly. If the prompt says “30 student devices,” use 30. If it says “design a subnet for the classroom,” include infrastructure when the scenario provides it. This prevents under-sizing caused by treating user count as the whole network.

Efficiency vs. flexibility

The smallest possible subnet minimizes unused addresses but can reduce operational flexibility

A /27 for 28 devices leaves only two ordinary host addresses free. That is mathematically efficient, but a single new printer and one replacement device could consume all remaining capacity. A /26 leaves far more headroom, but also creates a larger broadcast domain and may be more space than the design needs.

Addressing Exam Practice • How Many Hosts Per Subnet

Check whether How Many Hosts Per Subnet? has really stuck

Once students have worked through this topic, give them questions mixed in with the rest of the course. The Exam Prep Vault includes practice exams, multiple-choice questions and artifact labs so they cannot rely on a chapter heading to tell them what to do.

AP Networking Complete Exam Prep Vault
$39.99
GET THE EXAM PREP VAULT → See the Exam Prep Vault contents →
4 Practice Exams • 320 MCQs • 60 Artifact Labs

Smaller subnet

Conserves address space and limits broadcast-domain size, but leaves less growth room.

Larger subnet

Adds capacity and flexibility, but may widen the broadcast and policy boundary.

The right choice depends on the stated requirement, not a blanket rule that smaller or larger is always better.

DHCP exhaustion scenario

A subnet can have free host addresses while the DHCP pool is exhausted

Suppose a /25 has 126 traditional usable host addresses, but the administrator configured DHCP only from .50 through .100. That pool contains 51 addresses. Once all leases are active, new clients can fail to obtain an address even though many addresses elsewhere in the subnet are technically unused.

Subnet usable range: .1-.126 DHCP pool: .50-.100 Pool size: 51 Active leases: 51 Unused subnet IPs: many New DHCP client: cannot lease

This is a powerful evidence boundary: subnet capacity and DHCP scope capacity are related but not identical.

Premium Routing Feedback

Spend less time marking explanations about How Many Hosts Per Subnet?

When students explain their answer, it takes more than a right-or-wrong check to see what they understand. The Grading Copilot helps you review how they used the clues, where their explanation falls short and what feedback to give next. You make the final grading decision.

AP Networking Artifact Analysis Grading Copilot
$49.99
8 Criteria • 5 Task Modes • Offline Premium Copy
GET THE GRADING COPILOT → See the free Copilot preview
Reservation planning

Reservations consume address capacity even when they are not active every minute

A DHCP reservation removes an address from ordinary dynamic availability for a known device. If a subnet has 62 usable addresses and 20 are reserved for printers, cameras, and infrastructure, the dynamic client capacity is much lower than 62.

Strong planning therefore tracks three numbers separately: total usable subnet capacity, infrastructure/reserved consumption, and remaining dynamic pool headroom.

Binary intuition

Every host bit doubles the number of address combinations

One host bit creates 2 combinations. Two host bits create 4. Three create 8. That doubling is why subnet sizes always come in powers of two. CIDR is not producing arbitrary capacities; the capacities come directly from binary combinations.

Host bits: 2 → 4 total 3 → 8 total 4 → 16 total 5 → 32 total 6 → 64 total 7 → 128 total 8 → 256 total

Understanding this makes it easier to reconstruct the table even if you forget one value during an exam.

NEW • COMPLETE 180-DAY TEACHER CURRICULUM

Teach How Many Hosts Per Subnet? as part of a planned school year

This page gives you one topic. The 180-Day Teacher Curriculum puts it into a full course plan, with daily teaching notes, student activities and checks for understanding. Use it when you need to know what comes before this lesson and what to teach next.

AP Networking Complete 180-Day Teacher Curriculum
$199.99
180 Lessons • 180 Daily Simulators • 36 Teaching Weeks
GET THE 180-DAY CURRICULUM → See 3 free curriculum examples
Counterexample drill

A subnet that technically fits can still be the wrong answer if the requirement includes growth

Suppose the requirement says “support 28 devices today and 10 additional devices next semester.” A /27 supports 30 usable hosts, so it fits today's 28. But the actual design requirement is 38. A /26 is therefore the first traditional subnet that satisfies the full stated need.

This is exactly the kind of detail that separates arithmetic from design reasoning. The correct prefix comes from the whole requirement, not only the present count.

Subnetting evidence check

Use three independent checks when accuracy matters

For any host-capacity problem, verify the answer three ways: host-bit formula, known power-of-two block size, and boundary range. If all three agree, the chance of a silent arithmetic mistake drops sharply.

Example: /29 Check 1: 32 - 29 = 3 host bits 2^3 = 8 total 8 - 2 = 6 usable Check 2: Known /29 block size = 8 Check 3: Example block .40-.47 Network .40 Hosts .41-.46 = 6 Broadcast .47
Exam-speed method

Use the shortest reliable method under time pressure

For /24 through /30, knowing the host-count ladder is usually fastest: 254, 126, 62, 30, 14, 6, 2. If the prefix is unfamiliar, fall back to host bits and powers of two. If the question asks for a design choice, compare the usable count to the requirement and include headroom only when the scenario calls for it.

Fast does not mean skipping the distinction between total addresses and usable hosts. That wording difference is one of the easiest places to lose an otherwise simple question.

Free digital flashcards

24 How Many Hosts Per Subnet? digital flashcards

Practice host bits, powers of two, total addresses, traditional usable hosts, /24 through /30, reverse-capacity questions, DHCP pool differences, special cases, and exam wording.

All subnet cards
Click or press Enter/Space to reveal.
Show host bits, total addresses, and usable-host logic.
0 seen•24 cards
Continue studying

Connect host capacity to subnetting, addressing, DHCP, and troubleshooting