Subnet Cheat Sheet (CIDR, Mask & Hosts)
Every IPv4 prefix from /0 to /32 with its dotted-decimal subnet mask, wildcard, and host count — plus the /24 subnetting table, RFC 1918 private ranges, IPv6 prefixes, and the 7-second subnetting trick. Bookmark this. It answers 90% of subnet, CIDR and netmask questions in one glance.
Quick CIDR lookup
Type any IP/prefix (e.g. 192.168.1.0/24) — instant network details.
Full IPv4 CIDR table (/0 – /32)
Usable hosts = total addresses − 2 (network + broadcast), except /31 and /32 which follow RFC 3021.
| CIDR | Subnet mask | Wildcard | Total IPs | Usable hosts | Notes |
|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 | Class A range |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | Class A range |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | Class A range |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 | Class A range |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 | Class A range |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 | Class A range |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 | Class A range |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 | Class A range |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | Class A range |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | Class B range |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | Class B range |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | Class B range |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | Class B range |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | Class B range |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | Class B range |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | Class B range |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Class B range |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | Class C range |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | Class C range |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | Class C range |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Class C range |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | Class C range |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Class C range |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | Class C range |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Class C range |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Subnet of /24 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Subnet of /24 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Subnet of /24 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Subnet of /24 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Subnet of /24 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Subnet of /24 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (RFC 3021) | Subnet of /24 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (RFC 3021) | Subnet of /24 |
Subnetting a /24 (the table you actually use)
This is what CCNAs, NOC analysts and home-lab engineers reach for daily — how a /24 splits down. The block size is how far apart each subnet starts in the last octet.
| CIDR | Mask | Subnets in /24 | Hosts/subnet | Block size | Example |
|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 1 | 254 | 256 | 10.0.0.0 – 10.0.0.255 |
| /25 | 255.255.255.128 | 2 | 126 | 128 | 10.0.0.0 / 10.0.0.128 |
| /26 | 255.255.255.192 | 4 | 62 | 64 | 10.0.0.0, .64, .128, .192 |
| /27 | 255.255.255.224 | 8 | 30 | 32 | 10.0.0.0, .32, .64 … |
| /28 | 255.255.255.240 | 16 | 14 | 16 | 10.0.0.0, .16, .32 … |
| /29 | 255.255.255.248 | 32 | 6 | 8 | 10.0.0.0, .8, .16 … |
| /30 | 255.255.255.252 | 64 | 2 | 4 | Point-to-point links |
| /31 | 255.255.255.254 | 128 | 2 | 2 | P2P, RFC 3021 |
| /32 | 255.255.255.255 | 256 | 1 | 1 | Host route / loopback |
The 7-second subnetting trick
- Memorize the block sizes (powers of 2):
256, 128, 64, 32, 16, 8, 4, 2for /24 → /31. - Find the interesting octet — the one where the mask isn't 0 or 255.
- Divide the IP's value in that octet by the block size, round down, multiply back. That's your network address.
- Add
block size − 1to get the broadcast address.
Example: 192.168.1.100/27. Block size for /27 is 32. 100 ÷ 32 = 3.125 → 3 × 32 = 96. Network = 192.168.1.96, broadcast = 192.168.1.127, usable = .97 – .126.
Quick formulas
total addresses = 2^(32 − prefix)usable hosts = total − 2(for prefixes ≤ /30)wildcard mask = 255.255.255.255 − subnet maskbroadcast address = network OR wildcardnumber of subnets = 2^(new prefix − original prefix)
Private IP ranges (RFC 1918 & friends)
| Range | Addresses | Use |
|---|---|---|
| 10.0.0.0/8 | 16,777,216 | Large internal networks (RFC 1918) |
| 172.16.0.0/12 | 1,048,576 | Mid-size internal networks (RFC 1918) |
| 192.168.0.0/16 | 65,536 | Home & small office (RFC 1918) |
| 100.64.0.0/10 | 4,194,304 | Carrier-grade NAT (RFC 6598) |
| 169.254.0.0/16 | 65,536 | Link-local / APIPA (RFC 3927) |
| 127.0.0.0/8 | 16,777,216 | Loopback (RFC 1122) |
| 224.0.0.0/4 | — | Multicast (RFC 5771) |
| 0.0.0.0/8 | — | Reserved / unspecified |
IPv6 prefix quick reference
| Prefix | Use |
|---|---|
| /128 | Single host |
| /127 | Point-to-point link (RFC 6164) |
| /64 | Standard LAN segment |
| /56 | Typical home/site allocation |
| /48 | Site allocation (recommended minimum) |
| /32 | ISP allocation from RIR |
| fc00::/7 | Unique local (private) |
| fe80::/10 | Link-local |
| ::1/128 | Loopback |
Worked examples
- Mask
- 255.255.255.0
- Hosts
- 254
- Range
- .1 – .254
- Broadcast
- 192.168.1.255
- Mask
- 255.255.255.248
- Hosts
- 6
- Range
- 10.0.0.1 – 10.0.0.6
- Broadcast
- 10.0.0.7
- Mask
- 255.255.255.192
- Hosts
- 62
- Range
- 172.16.5.65 – .126
- Broadcast
- 172.16.5.127
- Mask
- 255.255.255.252
- Hosts
- 2
- Range
- 203.0.113.5 – .6
- Broadcast
- 203.0.113.7
Get the Network Engineer Starter Pack
A printable 5-page PDF: first-60-seconds triage, modern Linux network commands, BGP show commands & path-selection order, and a symptom → root-cause map. Free, no fluff.
FAQ
- What does the CIDR /24 mean?
- /24 means the first 24 bits identify the network and the last 8 bits identify hosts. The subnet mask is 255.255.255.0, giving 256 total addresses and 254 usable hosts (the network and broadcast addresses are reserved).
- What is a subnet mask, in plain English?
- A subnet mask is a 32-bit value that tells a device which portion of an IP address is the network and which is the host. 255.255.255.0 means the first three octets are the network and the last octet is the host.
- How do I convert a subnet mask to CIDR notation?
- Count the consecutive 1-bits from the left. 255.255.255.0 = 24 ones = /24. 255.255.255.192 = 26 ones = /26. The cheat sheet table above is the fastest reference.
- How many usable hosts in a /29 subnet?
- A /29 has 8 total addresses but only 6 are usable for hosts — one is the network address, one is the broadcast. /29 is common for point-to-point WAN handoffs that need a small pool.
- How many hosts in a /26?
- A /26 has 64 total addresses with 62 usable hosts. It splits a /24 into four equal subnets — useful when you need a handful of medium-sized VLANs.
- Why does /31 only have 2 addresses?
- RFC 3021 allows /31 on point-to-point links where both addresses are usable as endpoints — there is no network or broadcast address because there are only two hosts.
- Is /32 a single host?
- Yes. /32 represents exactly one IPv4 address — common for loopback interfaces, container IPs, and host routes in BGP / OSPF.
- How do I calculate the broadcast address?
- Broadcast = network OR wildcard. For 10.0.0.0/24: network 10.0.0.0, wildcard 0.0.0.255, broadcast 10.0.0.255. For 192.168.1.64/26: wildcard 0.0.0.63, broadcast 192.168.1.127.
- What is the 7-second subnetting trick?
- Memorize the block sizes: /24=256, /25=128, /26=64, /27=32, /28=16, /29=8, /30=4. The block size is how far apart each subnet starts. To find which subnet an IP belongs to, divide the relevant octet by the block size and round down.
- What are the private IP address ranges (RFC 1918)?
- 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are reserved for internal networks and are not routable on the public internet.