How Many Hosts Are in a /24 Subnet?
Beginner CalculateQuestion
A network administrator assigns the block 192.168.10.0/24 to a branch office. How many host bits does this prefix leave, how many total IP addresses does the block contain, and how many of those addresses can be assigned to devices?
Given
{
"prefix": 24
}
Answer
{
"host_bits": 8,
"total_addresses": 256,
"usable_hosts": 254
}
Try to solve it first, then click Reveal Answer
Step-by-Step Explanation
Step 1: Count the host bits
An IPv4 address has 32 bits total. The prefix length tells you how many bits are reserved for the network portion:
host_bits = 32 - prefix_length
host_bits = 32 - 24 = 8
Step 2: Calculate total addresses
The block size (total IP addresses) is 2 raised to the power of the host bits:
total_addresses = 2^host_bits
total_addresses = 2^8 = 256
So 192.168.10.0/24 spans 192.168.10.0 through 192.168.10.255 — exactly 256 addresses.
Step 3: Subtract reserved addresses
Every subnet reserves exactly two addresses that cannot be assigned to hosts:
| Address | Value | Purpose |
|---|---|---|
| Network address | 192.168.10.0 | Identifies the subnet itself |
| Broadcast address | 192.168.10.255 | Sends packets to all hosts in the subnet |
usable_hosts = total_addresses - 2
usable_hosts = 256 - 2 = 254
Summary
| Property | Value |
|---|---|
| Host bits | 8 |
| Total addresses | 256 |
| Network address | 192.168.10.0 |
| Broadcast address | 192.168.10.255 |
| Usable host range | 192.168.10.1 – 192.168.10.254 |
| Usable hosts | 254 |
A /24 is the most common subnet size for a single LAN segment because 254 hosts comfortably serves most office or home networks while keeping the address space easy to reason about.