Subnet mask cheat sheet (CIDR table)
This is the full IPv4 subnet table: each CIDR prefix with its subnet mask, wildcard mask, total addresses and usable hosts. To split a real network (network address, broadcast, first and last host), paste it into the FernTool subnet calculator.
CIDR to subnet mask table
| CIDR | Subnet mask | Wildcard | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16 777 216 | 16 777 214 | old “class A” |
| /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 | old “class B”, e.g. 172.16.0.0/16 |
| /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 | 4 × /24, common for a small ISP block |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | old “class C”, typical home or office LAN |
| /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 | 30 hosts, a small VLAN |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 6 hosts, a small static IP block from an ISP |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 2 hosts, classic router-to-router link |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (point-to-point link) | |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (single host) | one address, e.g. a firewall rule |
“Usable hosts” is the address count minus 2, because the first address is the network itself and the last is the broadcast address. /31 is the exception (RFC 3021 lets both addresses be used on a point-to-point link) and /32 is a single address.
How to work it out without a table
- Addresses in a subnet = 2 to the power of (32 − prefix). A /26 has 26 = 64 addresses, so 62 usable hosts.
- The “interesting” octet is the one where the mask isn’t 255 or 0. For /26 that’s the last octet: 256 − 64 = 192, so the mask is 255.255.255.192.
- Subnets start at multiples of the block size. With a block of 64, a /26 network starts at .0, .64, .128 or .192. So 192.168.1.100/26 sits in 192.168.1.64 to 192.168.1.127 (broadcast .127, hosts .65 to .126).
Quick reference for the last octet
- /25
- block 128: .0 and .128
- /26
- block 64: .0, .64, .128, .192
- /27
- block 32: .0, .32, .64 … .224
- /28
- block 16: .0, .16, .32 … .240
- /29
- block 8: .0, .8, .16 … .248
- /30
- block 4: .0, .4, .8 … .252
How many hosts do I need?
Pick the smallest prefix whose usable hosts cover today’s devices plus room to grow. 50 devices fit in a /26 (62 hosts); 200 devices need a /24 (254 hosts); 500 need a /23 (510 hosts). Home routers almost always use a /24 such as 192.168.1.0/24, which is plenty for a house.
Private ranges you can use inside a network
10.0.0.0/8(10.0.0.0 to 10.255.255.255)172.16.0.0/12(172.16.0.0 to 172.31.255.255)192.168.0.0/16(192.168.0.0 to 192.168.255.255)
These never appear on the public internet. See public vs private IP, or check your public IP.
What about IPv6?
IPv6 subnets are almost always a /64 for each network (that’s 18 quintillion addresses, so you never count hosts). A home usually gets a /56 or /48 from the ISP, which is 256 or 65 536 separate /64s. The subnet calculator handles IPv6 too. New to it? Read what is IPv6.
Frequently asked questions
What is the subnet mask for /24?
255.255.255.0. A /24 has 256 addresses and 254 usable hosts.
How many hosts are in a /27?
A /27 has 32 addresses and 30 usable hosts. Its mask is 255.255.255.224.
What is a wildcard mask?
The inverse of the subnet mask (255 minus each octet), used in Cisco ACLs and OSPF. The wildcard for 255.255.255.0 is 0.0.0.255.
Why are there two fewer usable hosts?
The first address identifies the network and the last is the broadcast address, so neither can be given to a device (except on /31 and /32).
More guides
- What is IPv6?
- How to find your IP address (every device)
- Public vs private IP address
- What is CGNAT (carrier-grade NAT)?
- How to hide your IP address
- How to find your PS5 IP address
- How to find your Xbox IP address
- How to find your smart TV’s IP address
- How to find your router’s IP address
- What is a good internet speed?
- Why is my internet slow at night?
- How to change DNS on Windows 11 and 10
- How to change DNS on a Mac
- How to change DNS on your router
- Public DNS servers compared
- Why port forwarding isn’t working
- Keeping your internet on during load-shedding
- Fibre vs LTE vs 5G in South Africa
- How to check if a port is open
- How to create a strong password
- What is a user agent?
- How to find your MAC address
- What is a good ping?
- How to find who owns an IP address
- How to find who owns a domain
- What is an IP address?