// subnet

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.

Updated

Quick CIDR lookup

Type any IP/prefix (e.g. 192.168.1.0/24) — instant network details.

Network
192.168.1.0
Broadcast
192.168.1.255
Mask
255.255.255.0
Wildcard
0.0.0.255
First host
192.168.1.1
Last host
192.168.1.254
Total IPs
256
Usable hosts
254

Full IPv4 CIDR table (/0 – /32)

Usable hosts = total addresses − 2 (network + broadcast), except /31 and /32 which follow RFC 3021.

CIDRSubnet maskWildcardTotal IPsUsable hostsNotes
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294Class A range
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646Class A range
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822Class A range
/3224.0.0.031.255.255.255536,870,912536,870,910Class A range
/4240.0.0.015.255.255.255268,435,456268,435,454Class A range
/5248.0.0.07.255.255.255134,217,728134,217,726Class A range
/6252.0.0.03.255.255.25567,108,86467,108,862Class A range
/7254.0.0.01.255.255.25533,554,43233,554,430Class A range
/8255.0.0.00.255.255.25516,777,21616,777,214Class A range
/9255.128.0.00.127.255.2558,388,6088,388,606Class B range
/10255.192.0.00.63.255.2554,194,3044,194,302Class B range
/11255.224.0.00.31.255.2552,097,1522,097,150Class B range
/12255.240.0.00.15.255.2551,048,5761,048,574Class B range
/13255.248.0.00.7.255.255524,288524,286Class B range
/14255.252.0.00.3.255.255262,144262,142Class B range
/15255.254.0.00.1.255.255131,072131,070Class B range
/16255.255.0.00.0.255.25565,53665,534Class B range
/17255.255.128.00.0.127.25532,76832,766Class C range
/18255.255.192.00.0.63.25516,38416,382Class C range
/19255.255.224.00.0.31.2558,1928,190Class C range
/20255.255.240.00.0.15.2554,0964,094Class C range
/21255.255.248.00.0.7.2552,0482,046Class C range
/22255.255.252.00.0.3.2551,0241,022Class C range
/23255.255.254.00.0.1.255512510Class C range
/24255.255.255.00.0.0.255256254Class C range
/25255.255.255.1280.0.0.127128126Subnet of /24
/26255.255.255.1920.0.0.636462Subnet of /24
/27255.255.255.2240.0.0.313230Subnet of /24
/28255.255.255.2400.0.0.151614Subnet of /24
/29255.255.255.2480.0.0.786Subnet of /24
/30255.255.255.2520.0.0.342Subnet of /24
/31255.255.255.2540.0.0.122 (RFC 3021)Subnet of /24
/32255.255.255.2550.0.0.011 (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.

CIDRMaskSubnets in /24Hosts/subnetBlock sizeExample
/24255.255.255.0125425610.0.0.0 – 10.0.0.255
/25255.255.255.128212612810.0.0.0 / 10.0.0.128
/26255.255.255.1924626410.0.0.0, .64, .128, .192
/27255.255.255.2248303210.0.0.0, .32, .64 …
/28255.255.255.24016141610.0.0.0, .16, .32 …
/29255.255.255.248326810.0.0.0, .8, .16 …
/30255.255.255.2526424Point-to-point links
/31255.255.255.25412822P2P, RFC 3021
/32255.255.255.25525611Host route / loopback

The 7-second subnetting trick

  1. Memorize the block sizes (powers of 2): 256, 128, 64, 32, 16, 8, 4, 2 for /24 → /31.
  2. Find the interesting octet — the one where the mask isn't 0 or 255.
  3. Divide the IP's value in that octet by the block size, round down, multiply back. That's your network address.
  4. Add block size − 1 to 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 mask
  • broadcast address = network OR wildcard
  • number of subnets = 2^(new prefix − original prefix)

Private IP ranges (RFC 1918 & friends)

RangeAddressesUse
10.0.0.0/816,777,216Large internal networks (RFC 1918)
172.16.0.0/121,048,576Mid-size internal networks (RFC 1918)
192.168.0.0/1665,536Home & small office (RFC 1918)
100.64.0.0/104,194,304Carrier-grade NAT (RFC 6598)
169.254.0.0/1665,536Link-local / APIPA (RFC 3927)
127.0.0.0/816,777,216Loopback (RFC 1122)
224.0.0.0/4Multicast (RFC 5771)
0.0.0.0/8Reserved / unspecified

IPv6 prefix quick reference

PrefixUse
/128Single host
/127Point-to-point link (RFC 6164)
/64Standard LAN segment
/56Typical home/site allocation
/48Site allocation (recommended minimum)
/32ISP allocation from RIR
fc00::/7Unique local (private)
fe80::/10Link-local
::1/128Loopback

Worked examples

192.168.1.0/24
Mask
255.255.255.0
Hosts
254
Range
.1 – .254
Broadcast
192.168.1.255
10.0.0.0/29
Mask
255.255.255.248
Hosts
6
Range
10.0.0.1 – 10.0.0.6
Broadcast
10.0.0.7
172.16.5.64/26
Mask
255.255.255.192
Hosts
62
Range
172.16.5.65 – .126
Broadcast
172.16.5.127
203.0.113.4/30
Mask
255.255.255.252
Hosts
2
Range
203.0.113.5 – .6
Broadcast
203.0.113.7
// free download

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.

No spam. Unsubscribe anytime. We send occasional updates when we ship new tools or cheatsheets.

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.

Related