Subnet Calculator
Enter an IP address with a CIDR prefix (e.g. 192.168.1.0/24) or a subnet mask (e.g. 10.0.0.0 255.255.0.0) to calculate all network details instantly.
Understanding Subnets and CIDR Notation
Subnetting divides a large IP network into smaller, manageable segments called subnets. Each subnet has its own address range, which improves security, reduces broadcast traffic, and allows for more efficient IP address allocation. CIDR (Classless Inter-Domain Routing) notation expresses this using a prefix length - The number after the slash indicates how many bits belong to the network portion.
How Subnet Masks Work
A subnet mask is a 32-bit number that divides an IP address into the network part (bits set to 1) and the host part (bits set to 0). For example, a /24 mask (255.255.255.0) means the first 24 bits identify the network, leaving 8 bits for host addresses - Giving 256 total addresses and 254 usable hosts.
Common Subnet Reference
| CIDR | Subnet Mask | Total Addresses | Usable Hosts | Use Case |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Large ISP / cloud provider blocks |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | RFC 1918 private range (172.16.0.0/12) |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Large campus / enterprise |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large office building or data center |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Medium enterprise network |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN subnet |
| /25 | 255.255.255.128 | 128 | 126 | Half of a /24 - Departmental segment |
| /26 | 255.255.255.192 | 64 | 62 | Small office floor or VLAN |
| /28 | 255.255.255.240 | 16 | 14 | Small VLAN / server cluster |
| /29 | 255.255.255.248 | 8 | 6 | Very small segment |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point WAN links |
| /31 | 255.255.255.254 | 2 | 2 | P2P links (RFC 3021 - No broadcast) |
| /32 | 255.255.255.255 | 1 | 1 | Single host route / loopback |
Common Subnet Sizes in Enterprise Networks
Relative frequency of subnet prefix use in enterprise environments
Frequently Asked Questions
They represent the same information in different formats. A subnet mask like 255.255.255.0 and a CIDR prefix like /24 both mean the first 24 bits of an IP address identify the network. CIDR is more compact and is the modern standard.
Every subnet reserves its first address as the network address (e.g. 192.168.1.0) and its last address as the broadcast address (e.g. 192.168.1.255). The broadcast address is used to send packets to all hosts simultaneously. This is why a /24 has 254 usable hosts, not 256.
A wildcard mask is the bitwise complement of a subnet mask. Where the subnet mask has a 1-bit (network portion), the wildcard mask has a 0-bit, and vice versa. Wildcard masks are used in Cisco ACLs and OSPF configurations to match ranges of IP addresses.