Short answer: the table below lists every IPv4 prefix from /8 to /32 with its subnet mask, wildcard mask and usable host count — the numbers that decide how big a /24 or a /29 really is. The three private ranges (RFC 1918) and the two IPv6 prefixes that matter in practice follow after it.
IPv4 subnet cheat sheet (/8 to /32)
“Usable hosts” subtracts the network address and the broadcast address from the total — the two addresses every subnet reserves for itself. /31 is the one exception: RFC 3021 lets both of its addresses be used, on a point-to-point link with no broadcast. /32 is a single host, often seen as a loopback or a route to one address.
| Prefix | Subnet mask | Wildcard mask | Total addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (RFC 3021, point-to-point only) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (single host) |
To work out network address, broadcast address and host range for one specific IP and prefix rather than looking it up, the subnet calculator does it for both IPv4 and IPv6 in the browser, nothing sent to a server.
The sizes you actually meet
Four prefixes cover almost every real network:
| Prefix | Usable hosts | Typical use |
|---|---|---|
| /24 | 254 | Default LAN or VPS subnet; one per site or VLAN |
| /29 | 6 | A small block of public IPs routed to a VPS or dedicated server |
| /30 | 2 | A point-to-point link between two routers |
| /32 | 1 | A single host route, or a loopback address |
A /29 is the smallest block most hosting providers hand out as “extra IPs” for a server, because a /30 or smaller leaves no room to grow and a provider still reserves the network and broadcast address from the /29 itself — 8 addresses on the wire, 6 you can actually assign.
Private IPv4 ranges (RFC 1918)
| Range | Prefix | Usable hosts |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,214 |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,574 |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,534 |
None of these three ranges are routed on the public internet — a router drops a packet addressed to one the moment it leaves a private network (RFC 1918, section 3). A VPS that needs a private network between several of its own servers, rather than a public subnet, typically gets a /24 out of one of these ranges from the provider’s panel.
IPv6: /64 and /48
IPv6 drops the broadcast address and the network/host split works differently, so the IPv4 table above does not carry over directly:
- There is no broadcast address, so every address in the range is usable.
- The lowest address in a subnet is not reserved either, unlike IPv4’s network address — it can be assigned to a host.
- Prefixes are almost always /64 or shorter (/56, /48); a /127 is the IPv6 equivalent of a /30, used on point-to-point router links (RFC 6164).
| Prefix | Addresses | Typical use |
|---|---|---|
| /64 | 18,446,744,073,709,551,616 (2^64) | One LAN segment — SLAAC needs exactly 64 host bits |
| /56 | 256 × /64 | A small site: 256 subnets to split up |
| /48 | 65,536 × /64 | A full site allocation from an ISP or RIR |
Working out a prefix by hand
The usable-host formula for IPv4 is 2^(32 − prefix) − 2. For a /27: 32 − 27 = 5 host bits, 2^5 = 32 addresses, minus the network and broadcast address leaves 30. The subnet mask comes from the same host-bit count: the last non-255 octet is 256 − 2^(host bits in that octet) — a /27 has 5 host bits all in the last octet, so 256 − 32 = 224, giving 255.255.255.224.
To check whether two addresses are in the same subnet, convert both to binary, apply the mask (AND each address with it) and compare the network portions — if they match, the addresses can reach each other without a router. Doing that by hand for anything wider than a /24 is exactly what the table above and a calculator are for.
Frequently asked
How many usable hosts does a /29 have?
6. A /29 has 8 total addresses (2^3), minus the network address and the broadcast address, leaving 6 that can be assigned to hosts.
What is the subnet mask for a /24?
255.255.255.0 — the standard mask for a default LAN or VPS subnet, with 254 usable host addresses.
Why does a /31 have 2 usable addresses instead of 0?
RFC 3021 makes an exception for /31 specifically: on a point-to-point link with no broadcast, both addresses in the pair can be used, unlike every other prefix where the first and last address are reserved.
Is a /64 the only subnet size IPv6 uses?
No, but it is by far the most common for a single network segment, because SLAAC (RFC 4862) is defined to use exactly 64 bits for the interface identifier. Larger allocations like a /56 or /48 exist to give one site room for many /64 subnets.