Subnet cheat sheet
Every IPv4 prefix length with its netmask, wildcard mask and size, and the IPv6 prefixes you'll meet most.
IPv4 subnets
/0 to /32| Prefix | Netmask | Wildcard | Addresses | Usable hosts | Size vs /24 | Notes |
|---|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 | 16,777,216 × /24 | The whole IPv4 space (a default route) |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | 8,388,608 × /24 | |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | 4,194,304 × /24 | |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 | 2,097,152 × /24 | |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 | 1,048,576 × /24 | |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 | 524,288 × /24 | |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 | 262,144 × /24 | |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 | 131,072 × /24 | |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 65,536 × /24 | Old class A size |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | 32,768 × /24 | |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | 16,384 × /24 | Carrier-grade NAT range (100.64.0.0/10) |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | 8,192 × /24 | |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 4,096 × /24 | 172.16.0.0/12 private range |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | 2,048 × /24 | |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | 1,024 × /24 | |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | 512 × /24 | |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 256 × /24 | Old class B size |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 × /24 | |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 × /24 | |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 × /24 | |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 × /24 | |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 × /24 | |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 × /24 | 1,024 addresses |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 × /24 | |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 × /24 | Old class C size; the smallest block most of the internet routes |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 2 per /24 | |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 4 per /24 | |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 8 per /24 | |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 16 per /24 | |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 32 per /24 | Small office or server segment |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 64 per /24 | Point-to-point link, the classic way |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | 128 per /24 | Point-to-point link (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | 256 per /24 | One host |
IPv6 prefixes
the common ones| Prefix | Addresses | /64 networks | Per /48 | Typical use |
|---|---|---|---|---|
| /3 | 2^125 | 2^61 | – | All global unicast space (2000::/3) |
| /12 | 2^116 | 2^52 | – | What IANA hands a regional internet registry |
| /32 | 2^96 | 2^32 | – | Typical ISP allocation from a regional registry |
| /48 | 2^80 | 65,536 | 1 | One site: the usual size for an organisation, and the longest prefix generally routed on the internet |
| /52 | 2^76 | 4,096 | 16 | Part of a site (16 fit in a /48) |
| /56 | 2^72 | 256 | 256 | Home or small office, a common ISP assignment |
| /60 | 2^68 | 16 | 4,096 | Smallest assignment some home ISPs give |
| /64 | 2^64 | 1 | 65,536 | One LAN or VLAN. SLAAC (automatic addressing) needs exactly /64 |
| /96 | 2^32 | – | 2^48 | Room for an embedded IPv4 address (NAT64 uses 64:ff9b::/96) |
| /126 | 4 | – | 2^78 | Point-to-point link (older practice) |
| /127 | 2 | – | 2^79 | Point-to-point link between routers (RFC 6164) |
| /128 | 1 | – | 2^80 | One host or a loopback address |
How it works
The prefix length (the number after the slash) is how many leading bits name the network. Each step shorter doubles the block: a /23 is two /24s, a /22 is four. The netmask is the same number written as four bytes, and the wildcard mask is the netmask flipped, as Cisco access lists use it.
Usable hosts is two less than the address count, because the first address names the network and the last is the broadcast. RFC 3021 makes two exceptions: a /31 link between two routers uses both its addresses, and a /32 is a single host.
IPv6 blocks are far bigger. A single /64 holds 264 addresses (about 18 quintillion), and every LAN gets one, because SLAAC (how devices give themselves an address) needs 64 host bits. Organisations usually get a /48, which holds 65,536 LANs. Links between routers can use a /127 (RFC 6164).
For a specific address, use the subnet calculator or the IPv6 subnet calculator. To convert one mask, use netmask to CIDR.