Insights
Subnet Cheat Sheet: IPv4 Masks, Host Counts and Boundaries
Look up IPv4 subnet masks, usable hosts and wildcard masks. Calculate subnet boundaries, size address blocks and compare IPv6 prefix capacities.

On this page
An IPv4 subnet cheat sheet links a CIDR prefix to its subnet mask and how many addresses it holds. The most common entries: /24 = 255.255.255.0, with 256 total addresses and 254 usable hostsOpens in a new tab; /26 = 255.255.255.192, with 64 total and 62 usable; and /30 = 255.255.255.252, with 4 total and 2 usable. A /31 has two usable addresses on a supported point-to-point linkOpens in a new tab, and a /32 is a single address.
In short:
- Total addresses = 2^(32 − prefix). Usable hosts = total − 2 (with exceptions for /31 and /32).
- Increment in the changing octet = 256 − mask value.
- Pick the smallest subnet that covers all your addresses, plus growth.
IPv4 prefixes, masks and host counts
| CIDR | Subnet mask | Total addresses | Usable hosts | Wildcard mask |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 (single address or host route) | 0.0.0.0 |
| /31 | 255.255.255.254 | 2 | 2 (supported point-to-point link) | 0.0.0.1 |
| /30 | 255.255.255.252 | 4 | 2 | 0.0.0.3 |
| /29 | 255.255.255.248 | 8 | 6 | 0.0.0.7 |
| /28 | 255.255.255.240 | 16 | 14 | 0.0.0.15 |
| /27 | 255.255.255.224 | 32 | 30 | 0.0.0.31 |
| /26 | 255.255.255.192 | 64 | 62 | 0.0.0.63 |
| /25 | 255.255.255.128 | 128 | 126 | 0.0.0.127 |
| /24 | 255.255.255.0 | 256 | 254 | 0.0.0.255 |
| /23 | 255.255.254.0 | 512 | 510 | 0.0.1.255 |
| /22 | 255.255.252.0 | 1,024 | 1,022 | 0.0.3.255 |
| /21 | 255.255.248.0 | 2,048 | 2,046 | 0.0.7.255 |
| /20 | 255.255.240.0 | 4,096 | 4,094 | 0.0.15.255 |
| /19 | 255.255.224.0 | 8,192 | 8,190 | 0.0.31.255 |
| /18 | 255.255.192.0 | 16,384 | 16,382 | 0.0.63.255 |
| /17 | 255.255.128.0 | 32,768 | 32,766 | 0.0.127.255 |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 0.0.255.255 |
The number after the slash in CIDR notation is how many bits make up the network prefix. The subnet mask shows that same boundary in dotted-decimal form. The wildcard maskOpens in a new tab is the inverse of the mask: subtract each mask octet from 255. A longer prefix leaves fewer host bits, so it describes a smaller block of addresses.
Use total addresses to see how big a block is, and usable hosts to estimate how many ordinary interfaces it can hold. In an ordinary broadcast subnet, the difference between the two columns is the network address and the broadcast address. /31 and /32 are exceptions, so their counts don't follow that subtraction.
Find the network, host range and broadcast
To find the subnet an address belongs to, locate the boundary at or below the address, then find the last address before the next boundary. For 192.168.1.130/26, the network is 192.168.1.128, the ordinary hosts run from 192.168.1.129 to 192.168.1.190, and the broadcast address is 192.168.1.191.
- Turn the prefix into a mask. A /26 uses
255.255.255.192. The octet that changes is the last one, where the mask value is 192. - Work out the increment in that octet. The increment is 256 minus the mask valueOpens in a new tab, so
256 - 192 = 64. Subnet boundaries fall at last-octet values.0,.64,.128and.192. - Find the boundary your address sits in. The last octet, 130, is between 128 and the next boundary, 192. Keep the shared prefix and use the lower boundary:
192.168.1.128. - Find the broadcast address. Take the address just before the next subnet,
192.168.1.192. That's192.168.1.191, which matches the /26 boundary and host-range patternOpens in a new tab. - Drop the two reserved endpoints. The first host comes right after the network address, and the last host comes right before the broadcast address. Here, the ordinary usable range is
192.168.1.129to192.168.1.190.
The increment belongs to whichever octet is changing, so it's not always the total address count. With /23, the mask is 255.255.254.0. The increment is 2 in the third octet, but the block holds 512 addresses. Set any host octets after the changing one to .0 for the network boundary and .255 for the broadcast boundary.
This math tells you which addresses belong to a subnet. It doesn't tell you the network works. Matching arithmetic doesn't mean routes, firewalls or interfaces are configured correctly. If a calculator gives a different answer, check the prefix you entered and which octet you used for the increment before you change any configuration.
Quick boundaries when splitting a /24
Inside a single /24, prefixes from /25 to /30 step through the last octet. The longer the child prefix, the smaller the blocks and the more of them fit in the same parent.
| Child prefix | Last-octet increment | Child subnets in one /24 | Ordinary usable hosts per child |
|---|---|---|---|
| /25 | 128 | 2 | 126 |
| /26 | 64 | 4 | 62 |
| /27 | 32 | 8 | 30 |
| /28 | 16 | 16 | 14 |
| /29 | 8 | 32 | 6 |
| /30 | 4 | 64 | 2 |
The subnet counts and boundary patternsOpens in a new tab are relative to the parent block. "Four /26 subnets" means four inside a /24, not four inside every possible network. A larger parent can hold more children of the same size.
For the parent 192.168.1.0/24, every address shares the first three octets, 192.168.1. Here's its complete /26 split:
| Network | First ordinary host | Last ordinary host | Broadcast |
|---|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
Read each row as one complete block: network first, ordinary hosts in the middle, broadcast last. To check a table like this, confirm that each broadcast address sits right before the next network address, and that each host range leaves out both endpoints. That catches a misplaced endpoint before you use the table to hand out addresses.
Size a private subnet for devices and services
Choose the smallest ordinary subnet whose usable hosts cover your whole address budget, including infrastructure and room to grow. Count the addresses you plan to assign, not just the devices you can see today.
- List the planned assignments. Include personal devices, self-hosted services and anything else that needs an address on this subnet. Count each address you need. A device doesn't always need just one.
- Include network infrastructure. Add the gateway and any management or service addresses that belong on the same subnet. They use up usable addresses even if they're not part of a dynamic pool.
- Allow room to grow. Put expected additions into the budget before you choose a prefix, so the capacity decision follows your plan and not a mask you happen to know.
- Compare the budget with the usable-hosts column. Pick the smallest subnet that meets the segment's needsOpens in a new tab, then choose an aligned network boundary. Check that your planned assignments fit inside its ordinary host range.
For example, a full budget of 30 addresses fits a /27, which has exactly 30 ordinary usable addresses. A /28 offers only 14, which is too few. If your budget grows past 30, a /26 gives you 62.
These private IPv4 blocksOpens in a new tab are address space you can carve smaller subnets from:
| Private block | Subnet mask | Address range |
|---|---|---|
| 10.0.0.0/8 | 255.0.0.0 | 10.0.0.0 through 10.255.255.255 |
| 172.16.0.0/12 | 255.240.0.0 | 172.16.0.0 through 172.31.255.255 |
| 192.168.0.0/16 | 255.255.0.0 | 192.168.0.0 through 192.168.255.255 |
Private addressing is a planning choice, not encryption or access control. Plan those protections separately, and don't treat a private address as proof that a service is isolated. And the usable-host count isn't automatically your DHCP pool size. Static assignments, configured exclusions and platform reservations can leave fewer addresses for dynamic allocation.
IPv6 prefix sizes at a glance
IPv6 uses 128-bit addresses and prefix notation, and its quick reference works best read on its own, apart from IPv4 host counts. For larger allocations, the useful comparison is how many /64 subnets fit inside the block.
| IPv6 prefix | Reference capacity |
|---|---|
| /48 | 65,536 /64 subnets |
| /56 | 256 /64 subnets |
| /60 | 16 /64 subnets |
| /64 | 1 /64 subnet |
| /127 | 2 total addressesOpens in a new tab |
| /128 | 1 total address |
The /64 subdivision countsOpens in a new tab describe parent and child relationships. They aren't required allocation sizes. A /56 holds 256 /64 subnets, and a /60 holds 16. Read the /127 and /128 rows differently, because they show total addresses, not counts of /64 subnets.
Don't carry the IPv4 habit of subtracting a network and broadcast address over to IPv6. The table shows how much address space a prefix holds. It doesn't guarantee a prefix suits every link or deployment. Follow your own network's allocation and link requirements, and don't treat /48, /56 or /64 as one-size-fits-all.
When the usable-host shortcut doesn't apply
For ordinary IPv4 broadcast subnets, total addresses = 2^(32 − prefix) and ordinary usable hosts = total addresses − 2. The subtraction covers the network and broadcast addresses. A /26 has 64 total addresses and 62 ordinary usable hosts, as the IPv4 capacity tableOpens in a new tab shows.
A supported /31 point-to-point link uses both addressesOpens in a new tab, so subtracting two would give the wrong answer. A /32 is a single address, including single-address and host-route uses. Pick the counting rule that fits the prefix and the type of link, instead of applying the ordinary shortcut automatically.
An address written with a prefix isn't necessarily the network address itself. In 192.168.1.130/26, the address is inside the subnet, while 192.168.1.128/26 names its network boundary. Also, an address ending in .0 or .255 isn't automatically unusable. In a larger block, either one can fall inside the host range instead of at the subnet's endpoints.
Configured pools and platform reservations can lower what you can actually assign without changing the subnet's mathematical capacity. Keep three things separate: the block's total addresses, its ordinary usable range and your configured assignment pool. If the pool is smaller than you expected, check its boundaries, exclusions and reserved assignments before you change the subnet size.