Subnet Mask Cheat Sheet: /8 to /32 Table with Hosts and Wildcards
For network administrators, security engineers, and CCNA students, mastering the relationship between CIDR prefixes, subnet masks, and host counts is fundamental. Whether you are designing a complex corporate architecture or configuring a simple home lab, having a reliable reference prevents configuration errors that can lead to connectivity loss or routing loops.
This guide serves as a definitive cheat sheet for IPv4 subnetting. We provide the precise mathematical mappings for every prefix from /8 up to /32, ensuring you have the exact figures needed for production environments.
IPv4 Subnet Mask Reference Table (/8 to /32)
Use the following table to quickly determine the subnet mask, wildcard mask, and host capacity for any given CIDR prefix. All values listed below are mathematically verified for accuracy.
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable IPs |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Decoding the Components of Subnetting
To effectively use the table above, it is important to understand how these different notations interact within a network environment. Modern networking relies heavily on Classless Inter-Domain Routing (CIDR), which replaced the old rigid class system (Class A, B, C).
The Subnet Mask
The subnet mask tells the router which bits of the IP address represent the network identity and which bits represent the individual device (the host). For example, in a /24 network, the first 24 bits are locked as the network ID, leaving 8 bits for hosts. This creates the familiar 255.255.255.0 mask.
The Wildcard Mask
While subnet masks are used for interface configuration, wildcard masks are critical for advanced configurations. They act as a filter. A bit set to 0 in a wildcard mask means "this bit must match," while a bit set to 1 means "I don't care about this bit." This makes them indispensable for creating flexible Access Control Lists (ACLs) and defining neighbor areas in OSPF.
Total vs. Usable Hosts
In almost every scenario involving RFC 1918 private IP ranges, you cannot use every IP in a block. Two addresses are always reserved:
- Network Address: The very first IP in the range (all host bits are 0).
- Broadcast Address: The very last IP in the range (all host bits are 1).
As seen in our table, a /24 has 256 total addresses but only 254 usable ones. Note that /31 and /32 are exceptions used for specialized purposes like loopbacks or direct point-to-point links.
Real-World Application Scenarios
Choosing the right subnet size depends entirely on the scale of your deployment. Using a subnet that is too large wastes valuable IP space, while one that is too small leads to frequent re-addressing projects.
Enterprise Core and Large Campus Networks (/8 to /16)
These massive blocks are rarely assigned to a single VLAN. Instead, they serve as the aggregate range for an entire organization. An enterprise might be assigned a /16 block, which they then carve into hundreds of smaller /24 or /27 subnets using Variable Length Subnet Masking (VLSM).
Standard Office LANs and User VLANs (/24)
The /24 is the "gold standard" for user access layers. It is easy to manage, fits perfectly into a single octet, and accommodates up to 254 devices. If a department grows beyond this, engineers often move to a /23, which doubles the capacity to 510 users without requiring a completely new IP scheme.
Server Segments and Management VLANs (/25 to /28)
Servers and infrastructure management ports (like iDRAC or ILO) typically require tighter security and smaller broadcast domains. Using a /27 (30 usable hosts) or /28 (14 usable hosts) allows administrators to isolate sensitive traffic and reduce noise on the wire.
WAN Links and Point-to-Point Connections (/30 to /31)
When connecting two routers via a leased line or a tunnel, you only need two IP addresses—one for each end of the link. A /30 is the traditional choice. However, many modern service providers now utilize /31 to conserve IPv4 space, as specified in RFC 3021.
Worked Example: Calculating a /26 Subnet
Let us walk through a practical example. Suppose you are tasked with setting up a guest Wi-Fi network using the base network 192.168.10.0/26. Here is how you apply the data from our cheat sheet:
- Identify the Mask: Looking at the table, a /26 corresponds to a subnet mask of
255.255.255.192. - Determine Capacity: The table shows a total of 64 IPs, with 62 being usable.
- Define the Range: Since the block size is 64, the network spans from
192.168.10.0to192.168.10.63. - Assign Special Addresses:
- Network Address:
192.168.10.0 - Broadcast Address:
192.168.10.63
- Network Address:
- Calculate Usable Range: The valid IPs for your wireless clients will be
192.168.10.1through192.168.10.62.
If you want to learn the manual math behind this process, refer to our step-by-step subnetting guide.
Common Pitfalls in Subnet Design
Even experienced engineers can make mistakes during the planning phase. Avoid these common traps to ensure network stability:
Overlapping Subnets
An overlap occurs when two different subnets claim the same IP address space. For example, if you define one network as 10.0.0.0/24 and another as 10.0.0.0/23, the second network completely encompasses the first. This causes routing ambiguity, where the router doesn't know which interface to use to reach a specific host.
Ignoring Broadcast Domain Size
While it is tempting to create one giant /16 subnet for simplicity, this increases "broadcast storms." Too many devices in one domain mean more ARP requests and DHCP traffic hitting every NIC on the segment, which degrades performance. Always balance your host needs with the necessity of segmentation.
Miscalculating Gateway Placement
By convention, the first usable IP (.1) or the last usable IP (.254 in a /24) is used as the Default Gateway. While technically any usable IP works, sticking to a consistent standard across your organization simplifies troubleshooting for the rest of the team.
Tips for CCNA Candidates
If you are studying for the Cisco Certified Network Associate (CCNA) exam, speed is essential. You won't always have a cheat sheet during the test. To improve your efficiency:
- Memorize Powers of 2: Know your sequence (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024) by heart.
- Focus on the Magic Number: Subtract the interesting octet of the subnet mask from 256 to find the block size. For a /26 (mask .192),
256 - 192 = 64. Your networks jump by increments of 64. - Practice Daily: Use various tools and solve CCNA subnetting practice questions to build muscle memory.
For further exploration of specific prefix sizes, you can visit our dedicated pages such as /24 details or /30 details to see deeper analysis of those particular configurations.
Frequently Asked Questions (FAQ)
Why are there usually two fewer usable hosts than the total number of IP addresses? →
In most standard subnets, the first address is reserved as the Network Address to identify the subnet itself, and the last address is reserved as the Broadcast Address to communicate with all devices on that subnet.
What is the difference between a subnet mask and a wildcard mask? →
A subnet mask identifies which part of an IP address belongs to the network and which belongs to the host. A wildcard mask is essentially the inverse of a subnet mask and is primarily used in Access Control Lists (ACLs) and routing protocols like OSPF to specify a range of addresses.
When should I use a /30 subnet versus a /31 subnet? →
Historically, /30 was the standard for point-to-point links because it provides 2 usable IPs after reserving the network and broadcast addresses. However, modern equipment supports /31 (per RFC 3021), which uses both available IPs for the interfaces, eliminating waste on point-to-point connections.
Which CIDR prefix is most commonly used for small office local area networks (LANs)? →
The /24 prefix is the industry standard for small to medium LANs, providing 254 usable host addresses, which is generally sufficient for a single department or a small office floor.
Can I have more than 254 hosts in a single subnet? →
Yes. By decreasing the CIDR prefix (e.g., moving from /24 to /23), you increase the size of the host portion of the address. For instance, a /23 subnet provides 510 usable host addresses.