Subnetting Cheat Sheet
Complete reference for IPv4 subnetting. All CIDR prefixes from /0 to /32 with subnet masks, wildcard masks, total hosts, and usable host counts.
All CIDR Prefixes /0 to /32
| CIDR | Subnet Mask | Wildcard Mask | Total Hosts | Usable Hosts | Class |
|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4295.0M | 4294967294 | A |
| /1 | 128.0.0.0 | 127.255.255.255 | 2147.5M | 2147483646 | A |
| /2 | 192.0.0.0 | 63.255.255.255 | 1073.7M | 1073741822 | A |
| /3 | 224.0.0.0 | 31.255.255.255 | 536.9M | 536870910 | A |
| /4 | 240.0.0.0 | 15.255.255.255 | 268.4M | 268435454 | A |
| /5 | 248.0.0.0 | 7.255.255.255 | 134.2M | 134217726 | A |
| /6 | 252.0.0.0 | 3.255.255.255 | 67.1M | 67108862 | A |
| /7 | 254.0.0.0 | 1.255.255.255 | 33.6M | 33554430 | A |
| /8 | 255.0.0.0 | 0.255.255.255 | 16.8M | 16777214 | A |
| /9 | 255.128.0.0 | 0.127.255.255 | 8.4M | 8388606 | B |
| /10 | 255.192.0.0 | 0.63.255.255 | 4.2M | 4194302 | B |
| /11 | 255.224.0.0 | 0.31.255.255 | 2.1M | 2097150 | B |
| /12 | 255.240.0.0 | 0.15.255.255 | 1.0M | 1048574 | B |
| /13 | 255.248.0.0 | 0.7.255.255 | 524.3K | 524286 | B |
| /14 | 255.252.0.0 | 0.3.255.255 | 262.1K | 262142 | B |
| /15 | 255.254.0.0 | 0.1.255.255 | 131.1K | 131070 | B |
| /16 | 255.255.0.0 | 0.0.255.255 | 65.5K | 65534 | B |
| /17 | 255.255.128.0 | 0.0.127.255 | 32.8K | 32766 | C |
| /18 | 255.255.192.0 | 0.0.63.255 | 16.4K | 16382 | C |
| /19 | 255.255.224.0 | 0.0.31.255 | 8.2K | 8190 | C |
| /20 | 255.255.240.0 | 0.0.15.255 | 4.1K | 4094 | C |
| /21 | 255.255.248.0 | 0.0.7.255 | 2.0K | 2046 | C |
| /22 | 255.255.252.0 | 0.0.3.255 | 1.0K | 1022 | C |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | C |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | C |
| /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 | 0 | — |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 0 | — |
Common CIDR Notations
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts | Common Use |
|---|---|---|---|---|---|
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Large network / VPC |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | Multi-site VLAN |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Standard LAN segment |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Small LAN / VLAN |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Small network segment |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Tiny network |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | DMZ / small VLAN |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Point-to-point (6 hosts) |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | P2P link |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | P2P (no broadcast) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host / loopback |
IPv6 Quick Reference
| Prefix | Subnets | Description |
|---|---|---|
| /64 | 18,446,744,073,709,551,616 | Standard subnet size (SLAAC-enabled) |
| /56 | 256 × /64 | Typical customer allocation |
| /48 | 65,536 × /64 | Typical site allocation |
| /44 | 1,048,576 × /64 | Large site allocation |
| /32 | 4,294,967,296 × /64 | Typical ISP allocation |
| /28 | 68,719,476,736 × /64 | Large ISP / LIR allocation |
Understanding the Subnetting Cheat Sheet
This cheat sheet provides a complete reference for IPv4 and IPv6 subnetting. Every CIDR prefix from /0 through /32 is listed with its corresponding subnet mask, wildcard mask, total number of IP addresses, and usable host count. Understanding these values is fundamental to IP network design, whether you are building a home lab, an enterprise network, or cloud infrastructure on AWS, Azure, or Google Cloud.
How to Read the Tables
The subnet mask is a 32-bit number that divides the IP address into the network portion (the 1-bits) and the host portion (the 0-bits). For example, a /24 prefix has a subnet mask of 255.255.255.0, meaning the first 24 bits identify the network and the remaining 8 bits identify hosts on that network. The wildcard mask is the bitwise inverse of the subnet mask and is used in access control lists (ACLs) and routing protocols such as OSPF and EIGRP to match ranges of IP addresses.
The total hosts column shows every IP address in the subnet, including the network address (all host bits zero) and the broadcast address (all host bits one). The usable hostscolumn subtracts these two reserved addresses to show how many addresses are available for assigning to devices. The two notable exceptions are /31 (used for point-to-point links where broadcast is unnecessary) and /32 (used for single-host loopback interfaces), where all addresses are usable.
Choosing the Right Prefix
Selecting the appropriate CIDR prefix depends on the number of devices you need to support. A /24 (256 addresses) is the standard for most LAN segments. Use /28 or /29 for small VLANs and DMZs where you only need a handful of addresses. A /30 is the classic point-to-point link size, providing exactly two usable IPs for router interfaces. In cloud environments, AWS VPC subnets typically start at /16 (the entire VPC) and break down into /24 or /20 subnets per availability zone.
For IPv6, the standard subnet size is always /64, which provides an enormous 18 quintillion addresses per subnet — enough for SLAAC (Stateless Address Autoconfiguration) to work. ISPs typically receive a /32 prefix, which gives them over 4 billion /64 subnets to allocate to customers. Enterprises usually receive a /48 prefix, providing 65,536 /64 subnets. This makes IPv6 subnetting far simpler than IPv4: you never need to calculate host counts, you just allocate /64s.
Use this cheat sheet alongside the Subnet Calculator for detailed calculations, or the Subnetting Quiz to test your knowledge.