Type a prefix after a slash, a subnet mask after a space, or pick a prefix from the list. IPv6 is detected automatically.
Subnet details
Divide into subnets
How to use the subnet calculator
- Type an address with its prefix, such as
192.168.1.10/24, or with a mask, such as192.168.1.10 255.255.255.0. For an IPv6 network, type something like2001:db8::/48. - Read the network, broadcast address, mask and usable host range. Each value has a copy button.
- To plan smaller networks, choose a size under Divide into subnets: the table lists every subnet that fits (the first 256 are shown).
CIDR prefixes and subnet masks
An IPv4 address has 32 bits. The prefix length says how many of them, from the left, identify the network; the rest number the hosts inside it. A /24 leaves 8 host bits, so 256 addresses, and its mask 255.255.255.0 is simply 24 ones followed by 8 zeros. The wildcard mask is the inverse, used by Cisco ACLs and OSPF.
In most IPv4 subnets the first address names the network and the last is the broadcast address, so neither can be given to a host: a /24 has 254 usable addresses. Two exceptions: a /31 has two usable addresses and no broadcast (RFC 3021, for point-to-point links), and a /32 is a single host, as used for loopbacks and floating IPs.
Common IPv4 subnet sizes
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Cloud providers reserve a few more addresses in each subnet for their own use (AWS keeps five), so check your provider’s figure when sizing a VPC.
IPv6 subnets
IPv6 addresses have 128 bits and no broadcast address. Networks for hosts are almost always a /64, because SLAAC address autoconfiguration needs 64 host bits. Sites usually receive a /48 or /56 from their provider, giving 65,536 or 256 /64 networks. The calculator writes addresses in the standard compressed form (RFC 5952) and shows the full form beside it.
Private and special ranges
The note above the results says what kind of address you entered. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918) and not routed on the internet; 100.64.0.0/10 is used by providers for carrier-grade NAT; fc00::/7 is the IPv6 equivalent of private space. Everything is calculated in your browser; nothing you type is sent to this site.