
Subnet cheat sheet: every prefix from /8 to /32 in one table
Every IPv4 prefix from /8 to /32 is in the table below with its netmask, its wildcard, the total number of addresses and the number you can hand to hosts. Usable is total minus two (the network and broadcast addresses) on every row except /31 and /32, which follow their own rules. If you have one specific address and want its network, broadcast and host range, type it into the subnet calculator. This page is the subnet cheat sheet that sits next to it, for the moments when you only need to know what a /22 is.
The CIDR chart, /8 to /32
The last column compares each block with a /24, the size most of us carry around in our heads.
| Prefix | Netmask | Wildcard | Addresses | Usable hosts | Size in /24s |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 65,536 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | 32,768 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | 16,384 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | 8,192 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 4,096 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | 2,048 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | 1,024 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | 512 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 256 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 1/2 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 1/4 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 1/8 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 1/16 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 1/32 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 1/64 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | 1/128 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | 1/256 |
A minute with the chart shows three patterns. Each row is exactly half the one above it, because each extra prefix bit halves the block. The wildcard is the netmask subtracted from 255, octet by octet, so 255.255.252.0 becomes 0.0.3.255. And a valid mask only ever uses nine values in any octet: 0, 128, 192, 224, 240, 248, 252, 254 and 255. If someone hands you a mask with 253 or 191 in it, the mask is wrong, not the chart.
Affiliate links: we may earn a commission. As an Amazon Associate I earn from qualifying purchases. We also earn from qualifying purchases on eBay.
Finding a subnet without the chart: the block-size trick
Memorizing 25 rows is not the goal. Find the octet where the mask stops being 255 (the interesting octet), subtract its value from 256, and you have the block size. Subnets in that octet start at multiples of it, and the address you are looking at falls into one of them.
Three addresses worked through by hand, each checked against the calculator's output:
10.20.30.200/27 mask 255.255.255.224 block 256 - 224 = 32, 4th octet
starts: 0, 32, 64 ... 192, 224 200 falls in 192 to 223
network 10.20.30.192 broadcast 10.20.30.223
hosts 10.20.30.193 to 10.20.30.222 (30 usable)
172.16.5.4/20 mask 255.255.240.0 block 256 - 240 = 16, 3rd octet
starts: 0, 16, 32 ... 5 falls in 0 to 15
network 172.16.0.0 broadcast 172.16.15.255
hosts 172.16.0.1 to 172.16.15.254 (4,094 usable)
10.44.7.9/22 mask 255.255.252.0 block 256 - 252 = 4, 3rd octet
starts: 0, 4, 8 ... 7 falls in 4 to 7
network 10.44.4.0 broadcast 10.44.7.255
hosts 10.44.4.1 to 10.44.7.254 (1,022 usable)
rack list
- TP-Link Omada TL-SG2008 smart switch8 x 1 GbESNMP v1/v2c/v3VLANs, LACPfanlessThe non-PoE sibling: VLANs, LACP and SNMP in a small fanless box.Amazon ›
- TP-Link Omada SG2008P smart PoE switch8 x 1 GbE4 x PoE+SNMP v1/v2c/v3Omada managedA smart switch that speaks SNMP, so the monitor can graph every port it powers.Amazon ›
- MikroTik CRS305-1G-4S+IN4 x SFP+ 10G1 x 1 GbESNMPRouterOS / SwOSFour SFP+ cages for 10 Gbit uplinks between a NAS, a server and the core.Amazon ›
Chosen from specifications and published reviews, not bench-tested by us.
The /20 and /22 cases are where people slip, because the host range spans several values of the third octet. 172.16.3.255 is an ordinary host address inside 172.16.0.0/20. Giving it to a printer is fine, whatever your /24 habits say.
If binary is easier for you, the /20 mask is 11111111.11111111.11110000.00000000: twenty ones, then twelve host bits, and 2 to the 12th is the 4,096 in the chart.
Splitting a /24
The most common real job is cutting one /24 into VLAN-sized pieces. For 192.168.10.0/24:
| Split into | Subnets | Network starts (4th octet) | Usable in each |
|---|---|---|---|
| /25 | 2 | 0, 128 | 126 |
| /26 | 4 | 0, 64, 128, 192 | 62 |
| /27 | 8 | 0, 32, 64 ... 224 | 30 |
| /28 | 16 | 0, 16, 32 ... 240 | 14 |
| /29 | 32 | 0, 8, 16 ... 248 | 6 |
| /30 | 64 | 0, 4, 8 ... 252 | 2 |
The first /26 is 192.168.10.0/26, hosts .1 to .62, broadcast .63, and the next one starts at .64. The calculator's split menu prints the same list with every range and broadcast spelled out, which is handy to paste into a change ticket.
/31 and /32: the two rows that break the rule
The usable column says 2 for both /30 and /31. That is not a typo.
A /30 has four addresses: network, two hosts, broadcast. For years it was the standard size for a point-to-point router link, and it spends half its space on addresses nobody can use. RFC 3021 allows a /31 on point-to-point links instead: two addresses, both assigned, no network address and no broadcast address. On a link with exactly two ends there is nobody else to broadcast to. 10.0.0.0/31 gives 10.0.0.0 to one router and 10.0.0.1 to the other.
The rules I keep for /31s:
- Use them only on true point-to-point links: router to router, router to firewall, a routed uplink between two switches. Not on a LAN segment, where hosts expect a broadcast address. Plan a /30 there.
- Check both ends before the change window. Current routing platforms generally accept a /31, but an older device or a small firewall may refuse the address or treat the lower one as a network address.
- Check your monitoring too. A discovery range or ping sweep that skips addresses ending in .0 will quietly miss one end of every /31 link.
A /32 is a single address: one in total, one usable, no separate network or broadcast address. You meet it as a router loopback (the address to point SNMP polling and BGP sessions at, because it stays reachable as long as any path to the box does), as a host route, and in ACL entries that match exactly one host. It is never a LAN.
The calculator treats both the way the chart does: a /31 shows two usable hosts and "none" for broadcast, a /32 shows one usable host.
Private and special ranges
These are the blocks you will meet inside networks and in lab notes. The counts come from the same arithmetic as the chart.
| Range | First | Last | Addresses | What it is |
|---|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 | 10.255.255.255 | 16,777,216 | Private (RFC 1918) |
| 172.16.0.0/12 | 172.16.0.0 | 172.31.255.255 | 1,048,576 | Private (RFC 1918) |
| 192.168.0.0/16 | 192.168.0.0 | 192.168.255.255 | 65,536 | Private (RFC 1918) |
| 100.64.0.0/10 | 100.64.0.0 | 100.127.255.255 | 4,194,304 | Shared space for carrier-grade NAT (RFC 6598) |
| 169.254.0.0/16 | 169.254.0.0 | 169.254.255.255 | 65,536 | Link-local |
| 127.0.0.0/8 | 127.0.0.0 | 127.255.255.255 | 16,777,216 | Loopback |
| 198.18.0.0/15 | 198.18.0.0 | 198.19.255.255 | 131,072 | Benchmarking (RFC 2544) |
| 192.0.2.0/24 | 192.0.2.0 | 192.0.2.255 | 256 | Documentation (RFC 5737), as are 198.51.100.0/24 and 203.0.113.0/24 |
The 172.16.0.0/12 row is the one people get wrong. It runs to 172.31.255.255, not 172.16.255.255, so 172.20.1.1 is private and 172.32.1.1 is not. The RFC 1918 blocks are not routed on the public internet, which is why every home router and most offices live in them. 100.64.0.0/10 looks private but is meant for providers' NAT; if your ISP uses carrier-grade NAT, building a lab in that range will collide with it. A host that shows a 169.254 address gave itself one because DHCP never answered, which is a fault to chase, not an address to document.
Picking a prefix for a host count
Work from the number of devices to the prefix, not the other way round. The smallest fit for each count, as the calculator's hosts field reports it:
| Hosts you need | Smallest fit | Usable |
|---|---|---|
| 2 (point-to-point link) | /31 | 2 |
| 6 | /29 | 6 |
| 14 | /28 | 14 |
| 30 | /27 | 30 |
| 50 | /26 | 62 |
| 100 | /25 | 126 |
| 200 | /24 | 254 |
| 255 | /23 | 510 |
| 1,000 | /22 | 1,022 |
| 4,000 | /20 | 4,094 |
Usable is not free. The default gateway takes one address, a redundant gateway pair takes three, and switches, access points, printers and DHCP reservations take more. I size a user VLAN at roughly twice today's count and round up to the next row. A /24 for a floor of 100 desks is not waste; it is the renumbering you will never have to schedule. The home VLAN plan applies the same thinking at house scale.
Where the wildcard column earns its place
Wildcards exist for ACLs and routing statements that match on "these bits must match, those can be anything". A standard Cisco IOS access list that lets one /27 of monitoring servers query SNMP, and an OSPF statement for the /22 from the worked example:
access-list 10 permit 10.20.30.192 0.0.0.31
snmp-server community n0c-r34d RO 10
router ospf 1
network 10.44.4.0 0.0.3.255 area 0
The net-snmp agent takes the prefix form instead, in snmpd.conf:
rocommunity n0c-r34d 10.20.30.192/27
Either way the community string only works from the monitoring subnet. It still crosses the wire in plain text, so on any network you do not fully trust, run SNMPv3 with authentication and privacy and keep the ACL as a second fence.
Before a new subnet goes into a config, run the same short check every time: the network address is a multiple of the block size, the mask uses only the nine legal octet values, the wildcard is 255 minus the mask, the gateway sits where your convention says (first or last usable), and a /31 is on a link where both ends support it. For any address you would rather not work out by hand, the subnet calculator gives the full answer in one line. Then write the result where the next person will look for it; the IPAM and diagrams guide covers a simple way to do that.
next: IPv4 subnet calculator for the numbers, the Rack list for the gear


