IPv4 Subnet Calculator (CIDR)
Get the network address, broadcast address, usable host range, and mask for any IPv4 CIDR block — instantly.
Subnet details
Binary breakdown
| IP | — |
| Mask | — |
| Network | — |
Common CIDR prefix lengths
| Prefix | Subnet mask | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Large enterprise / RFC1918 (10.0.0.0/8) |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Campus / RFC1918 (192.168.0.0/16) |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Large office |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN subnet |
| /26 | 255.255.255.192 | 64 | 62 | Small VLAN |
| /28 | 255.255.255.240 | 16 | 14 | Small IP block (DMZ, small VLAN) |
| /29 | 255.255.255.248 | 8 | 6 | Server rack / infrastructure |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point link |
| /31 | 255.255.255.254 | 2 | 2* | PtP link (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 | Single host / loopback |
Reserved private ranges (RFC 1918)
10.0.0.0/8— 16.7M addresses. Most flexible for large private networks.172.16.0.0/12— 1M addresses. Docker's default bridge range lives here.192.168.0.0/16— 65k addresses. Almost every home router uses a /24 from this block.
Fast way to size a subnet
You need N hosts. Round up to a power of 2, then add 2 for the network + broadcast. The prefix length is 32 - log₂(size). Or just use the table above — 14 hosts fit in /28, 30 hosts in /27, 60 hosts in /26, and so on.
FAQ
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) writes a subnet as an IP followed by a slash and the prefix length — e.g. 192.168.1.0/24. The prefix length is how many bits from the left are the network portion; the rest are hosts. /24 means 24 network bits + 8 host bits = 256 total addresses.
Why are there 2 fewer usable hosts than addresses?
In IPv4, the first address (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address — neither can be assigned to a host. So a /24 with 256 addresses gives you 254 usable IPs. /31 and /32 are special cases (RFC 3021 point-to-point links).
What's the difference between subnet mask and wildcard mask?
The subnet mask has 1s in network bits and 0s in host bits (e.g. 255.255.255.0). The wildcard mask is its inverse — 0s in network bits and 1s in host bits (e.g. 0.0.0.255). Cisco ACLs use wildcard masks; most other tools use subnet masks.
How do I pick the right subnet size?
Count your hosts, add ~20% headroom, then find the smallest prefix that fits: /30 = 2 usable, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126, /24 = 254. For point-to-point links use /30 (or /31 if your router supports RFC 3021).