How Subnet Masks Work, and Why a /26 Gives You 62 Hosts
A /26 gives you 62 usable addresses, not 64. Here is where the missing two go and how to split a network without guessing.
Quick answer: A subnet mask marks where the network part of an IP address ends and the host part begins. A /24 leaves 8 host bits, so 256 addresses and 254 usable. Every bit you move into the network halves the range, so a /26 gives 64 addresses and 62 usable hosts. The formula is 2 to the power of the host bits, minus 2.
Subnetting looks like arcane trivia right up until the first time you have to fit four departments onto one address range and nothing will talk to anything else. Then it gets very concrete very quickly. The whole subject rests on a single idea, and that idea is a line drawn through 32 bits.
The mask is a line through 32 bits
An IPv4 address is 32 bits, written as four numbers of 8 bits each. The mask says how many of those bits, counting from the left, belong to the network. Write /24 and you are saying the first 24 bits are network and the remaining 8 are host. Eight host bits gives 256 possible addresses.
Two of those 256 are spoken for. The first address in the block is the network address itself, and the last is the broadcast address. That leaves 254 for real machines. The rule generalises: a /25 gives 126 usable, a /26 gives 62, a /27 gives 30, and a /30 gives 2.
Reading /26 in dotted decimal
A /26 has 26 network bits, so the fourth octet has its top two bits set. In binary that is 11000000, which is 192, so the mask is 255.255.255.192. This is why real-world masks always use the same short list of numbers in the last non-zero position: 128, 192, 224, 240, 248, 252, 254, 255. Any other value in a mask is a typo.
Run your own numbers
It is free, there is no sign-up, and it works on your phone.
Open the Ip Subnet CalculatorSplitting one network into four
Take 192.168.1.0/24 and cut it into four /26 blocks. Each block holds 64 addresses, so the boundaries land at 0, 64, 128 and 192.
The first subnet is 192.168.1.0/26. Network address .0, broadcast .63, usable range .1 to .62. The second is 192.168.1.64/26, broadcast .127, usable .65 to .126. The third runs .128 to .191, usable .129 to .190. The fourth runs .192 to .255, usable .193 to .254. Four subnets, 62 devices each, 248 usable addresses out of the original 254. The six you lost are the extra network and broadcast addresses the split created.
Where each range starts and stops
The pattern repeats at every size, so it is worth committing to memory. The network address is always the first number in the block, the broadcast is always the last, and everything between is yours. A device configured with .63 on a /26 network will look like it is working fine until something tries to broadcast, at which point you get a fault that is genuinely unpleasant to trace.
The other size you meet constantly is /30: four addresses, two usable, which is what point-to-point links between routers use. A /31 is a special case. RFC 3021 allows both of its addresses to be used on a two-host link, because a point-to-point link has no need for a broadcast address.
Try it with your figures
No sign-up, no ads. Your inputs stay in your browser.
Use the Ip Subnet CalculatorHow to use the IP subnet calculator
Enter an address and a prefix, either as two fields or in CIDR form such as 192.168.1.0/24. The calculator returns the mask in dotted decimal, the network and broadcast addresses, the first and last usable host, and the total host count.
Work from the requirement, not from the mask. If a floor needs 40 devices, you need at least 40 usable addresses. A /27 gives 30, which is not enough. A /26 gives 62, which is, with room for the printers nobody mentioned. Then check the block boundaries so subnets do not overlap, because overlapping ranges produce the failure that takes longest to spot.
If you are checking the binary conversion by hand, the base conversion tools save a lot of scribbling. And while you are already inside the router admin page, that is the right moment to replace the default login with something from a proper password generator.
Common questions
How many hosts are in a /24? 254. There are 256 addresses in the block, minus the network address and the broadcast address.
What is the difference between /24 and 255.255.255.0? Nothing at all. They are two notations for the same mask, one as a bit count and one in dotted decimal. CIDR notation is shorter and much harder to mistype.
Why can't I use the first and last address in a subnet? The first identifies the network itself and the last is the broadcast address, which reaches every host on that subnet at once. Assigning either one to a device causes intermittent, confusing failures rather than a clean error.
Do I need to subnet a home network? Usually not. A single /24 handles 254 devices, which is more than most houses will ever hold. Splitting starts to earn its keep when you want guest devices or cameras isolated from the machines that hold your files.