Subnet Cheat Sheet
The complete IPv4 subnet mask reference table with CIDR notation, masks, host counts, and practical guidance.
Introduction
This cheat sheet is the reference you keep coming back to. Whether you are configuring firewall rules, planning a VPC, or troubleshooting routing, knowing your subnet sizes by heart saves time and prevents mistakes. Below you will find the complete table from /0 to /32, along with practical notes for the prefix lengths you will encounter most often.
If you want to calculate subnets interactively rather than scanning a table, our Subnet Calculator does the math for you in real time -- including binary visualization, subnet splitting, and overlap detection.
The Complete Subnet Reference Table
Each row below shows a CIDR prefix length, its corresponding subnet mask in dotted-decimal notation, the wildcard (inverse) mask used in access control lists, the total number of IP addresses in the block, and the number of usable host addresses (total minus the network and broadcast addresses, with special handling for /31 and /32).
| Prefix | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts |
|---|---|---|---|---|
| /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 |
Note two special cases at the bottom of the table. A /31 subnet has two addresses and both are usable, as defined by RFC 3021 for point-to-point links. A /32 represents a single host address and is commonly used in routing tables and host-specific firewall rules.
The Most Common Subnet Sizes
While you might encounter any prefix length in the wild, a handful of sizes come up in the vast majority of real-world networking scenarios. Here are the ones worth memorizing:
/24 -- The Default Subnet
With 254 usable hosts, /24 is the workhorse of networking. It corresponds to the old Class C address space and is the default subnet size in most home and small office networks. When someone says “a /24,” every network engineer immediately pictures 256 addresses with a 255.255.255.0 mask. If you are unsure what size to use, /24 is almost always a safe starting point.
/16 -- The VPC Standard
A /16 provides 65,534 usable hosts, which is the typical size for an AWS VPC or Azure Virtual Network. It gives you enough room to carve out dozens of /24 subnets across multiple availability zones and tiers (public, private, data). The 192.168.0.0/16 range is the most recognizable /16 in home networking.
/8 -- The Big Block
Over 16 million addresses in a single block. The entire 10.0.0.0/8 private range is one /8. Large enterprises use this as the root allocation for their entire internal network, then subdivide it into smaller blocks for regions, data centers, and departments.
/28 -- The Small Subnet
With 14 usable hosts, /28 is ideal for small DMZ segments, management VLANs, or any scenario where you need a handful of addresses and want to conserve IP space. AWS commonly uses /28 as the minimum subnet size.
/30 -- Point-to-Point Links
Only 2 usable hosts. Traditionally used for router-to-router point-to-point links where you only need one IP at each end. Modern networks increasingly use /31 for this purpose (RFC 3021), saving one additional address.
Understanding CIDR Notation
The number after the slash tells you how many of the 32 bits in an IPv4 address are fixed (the network portion). The remaining bits are available for host addresses. So /24 means 24 network bits and 8 host bits, giving you 2^8 = 256 total addresses.
A quick mental shortcut: every time you increase the prefix by 1, you halve the number of addresses. Going from /24 (256 addresses) to /25 (128 addresses) cuts the subnet in half. Going from /16 (65,536) to /17 (32,768) does the same. For a deeper dive into how this works at the binary level, see our guide on CIDR notation explained.
Wildcard Masks
The wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has 1s (network bits), the wildcard has 0s, and vice versa. Wildcard masks are used in Cisco ACLs and OSPF configurations. For example, the wildcard mask for /24 is 0.0.0.255, meaning “match any address where the last octet can be anything.”
A simple way to calculate wildcard masks: subtract each octet of the subnet mask from 255. For 255.255.255.0, the wildcard is 0.0.0.255. For 255.255.240.0, the wildcard is 0.0.15.255.
Tips for Choosing Subnet Sizes
- Plan for growth: If you need 50 hosts today, use a /25 (126 hosts) rather than a /26 (62 hosts). The extra addresses cost nothing but save you from painful re-addressing later.
- Align to power-of-two boundaries: Subnets always contain a power-of-two number of addresses. You cannot create a subnet with exactly 100 addresses -- the closest options are 64 (/26) and 128 (/25).
- Account for reserved addresses: The first address (network) and last address (broadcast) are not assignable to hosts. Also reserve addresses for gateways, DNS servers, and infrastructure devices.
- Use private ranges: For internal networks, always use RFC 1918 private address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
Try It Interactively
Tables are useful for quick reference, but nothing beats hands-on exploration. Our Subnet Calculator lets you type any CIDR and instantly see the full breakdown -- network address, broadcast, usable range, binary representation, and more. The Quick Reference Table tab within the tool is the interactive version of this cheat sheet, with filtering, row highlighting, and one-click copy.
Further Reading
- RFC 4632 — CIDR
The IETF standard defining classless inter-domain routing and CIDR notation.
- IANA IPv4 Address Space
Complete registry of global IPv4 address allocations.
- Subnetwork — Wikipedia
Overview of IP subnetting concepts, subnet masks, and network design.