IPv4 Subnetting, CIDR & VLSM Quick Reference
Every IPv4 address is just 32 bits split into a Network part (the street) and a Host part (the house number). Here is your complete CIDR table, VLSM shortcut, and CLI toolkit.
IPv4 32-Bit Anatomy
An IPv4 address has 4 octets (8 bits each = 32 bits total). The /prefix
(CIDR notation) tells routers how many bits from the left belong to the network.
192.168.10.25 /24
Network Bits vs. Host Bits (Visualized)
Network bits (cyan) stay identical for every device on the subnet. Host bits (green) change for each device.
01 CIDR /8 to /32 Master Table
Use this master lookup table to convert any /prefix into its Subnet Mask, Wildcard Mask
(used in router ACLs & OSPF), Total IPs, and Usable Hosts (Total - 2 for Network
& Broadcast).
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts | Common Use |
|---|---|---|---|---|---|
/8 |
255.0.0.0 |
0.255.255.255 |
16,777,216 | 16,777,214 | Legacy Class A / RFC 1918 10/8 |
/9 |
255.128.0.0 |
0.127.255.255 |
8,388,608 | 8,388,606 | Large ISP allocation |
/10 |
255.192.0.0 |
0.63.255.255 |
4,194,304 | 4,194,302 | CGNAT (100.64.0.0/10) |
/11 |
255.224.0.0 |
0.31.255.255 |
2,097,152 | 2,097,150 | Regional ISP block |
/12 |
255.240.0.0 |
0.15.255.255 |
1,048,576 | 1,048,574 | RFC 1918 172.16.0.0/12 |
/13 |
255.248.0.0 |
0.7.255.255 |
524,288 | 524,286 | Large enterprise backbone |
/14 |
255.252.0.0 |
0.3.255.255 |
262,144 | 262,142 | Multi-region cloud VPC |
/15 |
255.254.0.0 |
0.1.255.255 |
131,072 | 131,070 | Large campus network |
/16 |
255.255.0.0 |
0.0.255.255 |
65,536 | 65,534 | Default Cloud VPC (AWS/Azure) |
/17 |
255.255.128.0 |
0.0.127.255 |
32,768 | 32,766 | Half of a /16 |
/18 |
255.255.192.0 |
0.0.63.255 |
16,384 | 16,382 | Large data center zone |
/19 |
255.255.224.0 |
0.0.31.255 |
8,192 | 8,190 | Medium enterprise block |
/20 |
255.255.240.0 |
0.0.15.255 |
4,096 | 4,094 | Cloud Availability Zone |
/21 |
255.255.248.0 |
0.0.7.255 |
2,048 | 2,046 | University / Hospital Wi-Fi |
/22 |
255.255.252.0 |
0.0.3.255 |
1,024 | 1,022 | Corporate office building |
/23 |
255.255.254.0 |
0.0.1.255 |
512 | 510 | Double-LAN (2 ร /24) |
/24 |
255.255.255.0 |
0.0.0.255 |
256 | 254 | Standard Home / Office LAN |
/25 |
255.255.255.128 |
0.0.0.127 |
128 | 126 | Half LAN / Department VLAN |
/26 |
255.255.255.192 |
0.0.0.63 |
64 | 62 | Small office / Server tier |
/27 |
255.255.255.224 |
0.0.0.31 |
32 | 30 | DMZ / Small public block |
/28 |
255.255.255.240 |
0.0.0.15 |
16 | 14 | Management / Bastion subnet |
/29 |
255.255.255.248 |
0.0.0.7 |
8 | 6 | Tiny ISP static IP block |
/30 |
255.255.255.252 |
0.0.0.3 |
4 | 2 | Router-to-Router Point-to-Point |
/31 |
255.255.255.254 |
0.0.0.1 |
2 | 2* | RFC 3021 P2P Link (no broadcast) |
/32 |
255.255.255.255 |
0.0.0.0 |
1 | 1 | Single Host / Firewall Allowlist |
02 Private & Special IPv4 Ranges
Not all IPv4 addresses can be routed on the public internet. Memorize these reserved ranges so you can instantly spot local, ISP, or broken-DHCP traffic.
10.0.0.0 โ 10.255.255.255Enterprise LANs, Cloud VPCs, Kubernetes
172.16.0.0 โ 172.31.255.255Docker bridge networks, corporate VPNs
192.168.0.0 โ 192.168.255.255Home routers & small office networks
| Range (CIDR) | Address Span | Name / RFC | What It Means in Real Life |
|---|---|---|---|
127.0.0.0/8 |
127.0.0.1 โ 127.255.255.254 |
Loopback (RFC 1122) | "Talk to myself" โ local machine testing (localhost). Never leaves
the NIC. |
169.254.0.0/16 |
169.254.0.1 โ 169.254.255.254 |
APIPA / Link-Local (RFC 3927) | Auto-assigned when DHCP fails. Also used for AWS/Azure metadata
(169.254.169.254). |
100.64.0.0/10 |
100.64.0.0 โ 100.127.255.255 |
CGNAT (RFC 6598) | Carrier-Grade NAT shared by ISPs, plus mesh VPNs like Tailscale. |
0.0.0.0/8 |
0.0.0.0 |
Unspecified / "This Network" | In servers: "listen on all interfaces." In routing: default route
(0.0.0.0/0). |
224.0.0.0/4 |
224.0.0.0 โ 239.255.255.255 |
Multicast (RFC 5771) | One-to-many traffic (OSPF 224.0.0.5, mDNS 224.0.0.251).
|
03 VLSM & Magic Number Memory Trick
VLSM (Variable Length Subnet Masking) means carving a big network into different-sized
pieces so you don't waste IPs (e.g., /26 for 50 users, /30 for a 2-router
link). Always allocate the largest subnet first.
Want to find the block size of any subnet in 3 seconds? Subtract the non-255, non-0 octet of the subnet mask from 256!
Example: Mask 255.255.255.192 (/26) โ Interesting
octet is 192 โ 256 - 192 = 64.
Your subnets jump by 64: .0, .64,
.128, .192!
Quick Subnet Calculator CLI Commands
ipcalc 192.168.10.45/26
Linux / macOS
.0), Broadcast
(.63), HostMin (.1), HostMax (.62), and Hosts
(62).sipcalc 10.20.30.40/22
Linux / BSD
ipcalc 172.16.0.0/24 -s 60 20 2
Linux (ipcalc VLSM)
172.16.0.0/24 into blocks for 60 hosts
(/26), 20 hosts (/27), and 2 hosts (/30).python3 -c "import ipaddress; n=ipaddress.ip_network('192.168.1.0/24'); print(list(n.subnets(new_prefix=26)))"
Cross-Platform (No Install)
04 Binary Powers of 2 Quick Table (20โ28)
Every subnetting calculation boils down to powers of 2. Keep this chart handy to convert binary bits
to decimal octets and calculate host counts (2h - 2).
| Power | Value (2n) | Bit Position (Octet) | Cumulative Subnet Mask | Usable Hosts (if h = n) |
|---|---|---|---|---|
20 |
1 | 00000001 (8th bit) |
255 (8 bits on) |
/32 โ 1 host |
21 |
2 | 00000010 (7th bit) |
254 (7 bits on) |
/31 โ 2* (P2P) |
22 |
4 | 00000100 (6th bit) |
252 (6 bits on) |
/30 โ 2 hosts |
23 |
8 | 00001000 (5th bit) |
248 (5 bits on) |
/29 โ 6 hosts |
24 |
16 | 00010000 (4th bit) |
240 (4 bits on) |
/28 โ 14 hosts |
25 |
32 | 00100000 (3rd bit) |
224 (3 bits on) |
/27 โ 30 hosts |
26 |
64 | 01000000 (2nd bit) |
192 (2 bits on) |
/26 โ 62 hosts |
27 |
128 | 10000000 (1st bit) |
128 (1 bit on) |
/25 โ 126 hosts |
28 |
256 | Full Octet (Magic #) | 0 (0 bits on) |
/24 โ 254 hosts |
05 Danger Zone: Subnetting Mistakes
.0 (Network ID) or .255 (Broadcast) to a
Host: In a /24, 192.168.1.0 names the network and
192.168.1.255 shouts to everyone. Assigning either to a server or gateway
causes silent packet drops. (Note: in a /23 like 192.168.0.0/23,
192.168.0.255 and 192.168.1.0 are valid host IPs!)
10.0.1.0/24 to
Office A and 10.0.0.0/22 to Office B means Office B swallows Office A's range.
VPN tunnels and cloud VPC peering will fail or misroute traffic.
/32 with /24 in Firewall Rules:
Allowing 203.0.113.15/24 opens SSH/RDP to 254 strangers in that block. Always
use /32 for a single IP address.
/28 (16 IPs) only gives you 11 usable cloud IPs.