Subnetting splits a network into smaller pieces, and CIDR notation tells you how big each piece is. This guide walks through a subnet calculation from scratch, with no networking background assumed.
What CIDR notation means
An address like 192.168.1.0/24 has two parts: the IP address and the prefix length after the slash. The prefix length counts how many bits belong to the network. A /24 means the first 24 bits are the network part and the remaining 8 bits are for hosts. The higher the number after the slash, the smaller the network.
The key numbers for any subnet
For a /24 network: the network address is 192.168.1.0, the broadcast address is 192.168.1.255, and the usable host range runs from 192.168.1.1 to 192.168.1.254. That is 254 usable hosts. Two addresses are always reserved: the network address itself and the broadcast address, which is why the count is total addresses minus two.
Step-by-step: work out a host range
- Write down the CIDR prefix, for example /26.
- Count the host bits: 32 minus the prefix. For /26, that is 6 host bits.
- Work out total addresses: 2 raised to the host bits. For 6 bits, that is 64 addresses.
- Subtract 2 for the network and broadcast addresses. Usable hosts: 62.
- Find the block size, which equals the total addresses: 64. Subnets fall on multiples of 64 in the last octet: 0, 64, 128, 192.
- For the subnet starting at 192.168.1.64, the network address is .64, the broadcast is .127, and usable hosts run from .65 to .126.
Common prefix sizes to remember
- /24: 256 addresses, 254 usable hosts.
- /25: 128 addresses, 126 usable hosts.
- /26: 64 addresses, 62 usable hosts.
- /27: 32 addresses, 30 usable hosts.
- /28: 16 addresses, 14 usable hosts.
- /30: 4 addresses, 2 usable hosts, often used for links between two routers.
Common mistakes
Forgetting to subtract the network and broadcast addresses is the classic error; it overstates the host count by two. Another is starting a subnet at the wrong boundary: subnets must start on multiples of the block size. A /26 subnet can start at .0, .64, .128, or .192, never at .32 or .100.
Try it the faster way
Enter any IP address and CIDR prefix in the tool below to get the network, broadcast, and host range instantly.
Prefer the full page? Open the IP subnet calculator directly.
Quick tips
- Memorize the powers of two up to 2 to the 8th: 2, 4, 8, 16, 32, 64, 128, 256.
- Always sanity-check: the broadcast address is one less than the next subnet’s network address.
- Pick the smallest subnet that fits your host count, with room to grow.
Subnet math is just powers of two and careful boundaries. Learn the /24 to /30 table by heart, and most real-world subnets become quick mental arithmetic.
Frequently asked questions
What is the difference between a subnet mask and CIDR notation? They express the same thing. A /24 prefix equals the mask 255.255.255.0, and a /26 equals 255.255.255.192. CIDR is shorter and less error-prone, which is why modern networking prefers it.
Why are two addresses always unusable in a subnet? The lowest address identifies the network itself, and the highest is the broadcast address used to reach every host at once. Neither can belong to a single device, so usable hosts always equal total addresses minus two, except in special point-to-point cases.
How do I pick a subnet size for an office? Count the devices, add room for growth of at least 25 percent, then pick the smallest prefix that fits. A /24 suits up to 254 hosts; a /25 suits up to 126. Oversizing wastes addresses, but undersizing forces a painful renumbering later.
