IPv4 Subnetting Cheat Sheet
A practical, reusable reference for CIDR notation, subnet masks, usable hosts, and planning smaller networks.
What does a CIDR prefix mean?
IPv4 addresses contain 32 bits. In CIDR notation, the number following the slash tells you how many leading bits identify the network. For example, 192.168.10.0/24 uses 24 network bits and has eight bits available for addresses inside that network. Because there are two choices per bit, a /24 contains 28, or 256, total addresses.
For a traditional IPv4 LAN, the all-zero host portion identifies the network, and the all-one host portion is the directed broadcast address. That leaves 254 typically assignable device addresses in a /24. There are important exceptions: a /31 can support two endpoints on a point-to-point link, and a /32 identifies one address.
Useful CIDR subnet table
| CIDR | Subnet mask | Total addresses | Traditional usable hosts |
|---|---|---|---|
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
How to calculate a network boundary
Suppose a device has address 192.168.10.135/26. A /26 contains 64 addresses per block, so the boundaries in the last octet are 0, 64, 128, and 192. The device belongs to 192.168.10.128/26. That block ends at 192.168.10.191, with the traditional LAN host range from .129 through .190.
You can also compute the network by a bitwise AND between the address and the subnet mask. The wildcard mask is the inverse of the subnet mask; a /26 wildcard is 0.0.0.63.
Planning networks with VLSM
Variable-Length Subnet Masking (VLSM) allows multiple different-sized subnets inside a single allocation. Design from the largest segment to the smallest. A group needing 120 addresses generally needs a /25 (126 traditional usable hosts). A group needing 60 addresses fits in a /26 (62 hosts). A group of 28 fits a /27 (30 hosts). Remember to include gateways, printers, network appliances, and room for growth when sizing requirements.
What to verify before applying a plan
Make sure networks do not overlap, routing and firewall rules recognize the intended subnet, DHCP scopes exclude infrastructure addresses, and the plan avoids existing VPN, cloud, and remote-office networks. Use a subnet allocation worksheet or the tools below to check your math.