CIDR Notation and Subnetting Explained
What /24 and /26 mean, how to find the network address, broadcast address and usable hosts, with a full CIDR table and a worked IPv4 subnetting example.
CIDR notation writes a network as an address plus a slash and a number, such as 192.168.1.0/24. The number says how many of the 32 bits in an IPv4 address identify the network; the rest identify hosts inside it. Once that clicks, subnetting is arithmetic with powers of two.
To check your answers, enter any address and prefix in the subnet calculator.
Subnet CalculatorEnter an address in CIDR notation to get the network and broadcast addresses, the usable host range, netmask, wildcard mask and address counts. IPv4 and IPv6 both work, and everything is calculated in your browser without any lookup.What the prefix length means
An IPv4 address is 32 bits. In /26, the first 26 bits are the network and the last 6 bits are for hosts.
- Number of addresses: 2 raised to the host bits, so
/26gives 2^6 = 64. - Usable hosts: that number minus 2, because the first address is the network address and the last is the broadcast address.
/26gives 62.
Two exceptions: a /31 has 2 usable addresses for point-to-point links (RFC 3021), and a /32 is a single host.
CIDR table
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
/8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
/16 | 255.255.0.0 | 65,536 | 65,534 |
/24 | 255.255.255.0 | 256 | 254 |
/25 | 255.255.255.128 | 128 | 126 |
/26 | 255.255.255.192 | 64 | 62 |
/27 | 255.255.255.224 | 32 | 30 |
/28 | 255.255.255.240 | 16 | 14 |
/29 | 255.255.255.248 | 8 | 6 |
/30 | 255.255.255.252 | 4 | 2 |
Worked example: 192.168.1.130/26
- Block size.
/26has 64 addresses per subnet, so subnets start at multiples of 64 in the last octet: 0, 64, 128, 192. - Find the block. 130 lies between 128 and 191, so the network address is 192.168.1.128.
- Broadcast. The last address of that block is 128 + 63 = 192.168.1.191.
- Usable range. 192.168.1.129 to 192.168.1.190, which is 62 hosts.
Splitting a network
To divide 192.168.1.0/24 into four equal subnets, borrow 2 host bits, giving four /26 blocks:
| Subnet | Range |
|---|---|
| 192.168.1.0/26 | .0 to .63 |
| 192.168.1.64/26 | .64 to .127 |
| 192.168.1.128/26 | .128 to .191 |
| 192.168.1.192/26 | .192 to .255 |
Each extra bit you move into the network portion doubles the number of subnets and halves the size of each.
Practical notes
- Private ranges are
10.0.0.0/8,172.16.0.0/12and192.168.0.0/16. - Cloud providers reserve extra addresses. AWS, for example, reserves five per subnet, so a
/28there has 11 usable addresses, not 14. Check your provider's rules before sizing small subnets. - Leave room to grow. Renumbering a subnet later is far more painful than choosing a slightly larger prefix now.
- IPv6 works the same way with 128 bits. A
/64is the standard size for a single subnet, and you do not count usable hosts by hand because the space is so large.
