The Complete Guide to CIDR Subnetting
Whether you are designing a VPC in AWS, segmenting an on-prem network, or writing firewall ACLs, understanding CIDR notation and subnetting math is a core skill for any network engineer, sysadmin, or DevOps practitioner. This guide explains how the numbers work so you can subnet confidently without memorizing tables.
How to Use This Calculator
Enter any IPv4 address in the top field (e.g. 10.0.0.0) and adjust the CIDR prefix slider or type a prefix length (1-32). The subnet mask dropdown and prefix fields are two-way bound: changing one updates the others instantly. Results appear in real time with no button press needed.
The binary breakdown panel below the results shows exactly which bits belong to the network portion (green ones) and which belong to the host portion, making the bitwise AND operation that computes the Network Address visually obvious.
How Subnet Math Works
Every IPv4 address is a 32-bit integer. The CIDR prefix (e.g. /24) tells you how many leading bits identify the network. A /24 produces a subnet mask of 24 ones followed by 8 zeros, which in decimal is 255.255.255.0.
- Network Address: IP AND Subnet Mask (zero out all host bits)
- Broadcast Address: Network Address OR NOT(Subnet Mask) (set all host bits to 1)
- Total IPs: 2 raised to the power of (32 minus the prefix length)
- Usable Hosts: Total IPs minus 2 (remove network and broadcast addresses)
- Wildcard Mask: 255.255.255.255 minus the subnet mask, octet by octet
Choosing the Right Prefix Size
For cloud VPCs, a /16 gives 65,534 usable hosts - large enough to subdivide further into application tiers. A /24 (254 hosts) is a common workload subnet. A /28 (14 hosts) suits small services like NAT gateways or load balancers. Going smaller than /28 is rare but valid.
For point-to-point router links, use /30 (2 usable hosts) or /31 per RFC 3021 (2 IPs, both usable). Use /32 as a host route for loopback addresses or precise BGP advertisements.
RFC 1918 Private Ranges to Know
- 10.0.0.0/8 - Class A private range, 16,777,214 usable hosts. Common in large enterprise and cloud VPCs.
- 172.16.0.0/12 - Class B private range, 1,048,574 usable hosts. Often used in data center fabrics.
- 192.168.0.0/16 - Class C private range, 65,534 usable hosts. Standard in home and small office networks.
Broadcast Storm Risk at Large Prefix Sizes
When a single subnet contains tens of thousands of hosts (e.g. /8 or /12), every broadcast packet - ARP requests, DHCP, routing updates - is delivered to every device simultaneously. This can saturate links and CPU cycles in a broadcast storm. The calculator flags subnets above a threshold with a warning badge to prompt you to consider further segmentation using VLANs or smaller subnets.