What does /24 mean in an IP address?
The number after the slash counts how many leading bits identify the network. A /24 fixes the first 24 bits, leaving 8 for hosts — 256 addresses, of which 254 are usable once the network and broadcast addresses are excluded.
Updated 2026-08-24
The mask splits the address in two
An IPv4 address is thirty-two bits, conventionally written as four decimal numbers of eight bits each. Every address carries two pieces of information at once: which network it belongs to, and which host it is within that network. The subnet mask is what says where one ends and the other begins.
The mask is also thirty-two bits, and it is always a run of ones followed by a run of zeros — never mixed. Where the mask has a one, that bit of the address is part of the network identifier. Where it has a zero, that bit identifies the host. So a mask of 255.255.255.0 is twenty-four ones followed by eight zeros, meaning the first three octets name the network and the last names the host.
CIDR notation writes this far more compactly. The number after the slash is simply how many leading ones the mask has, so /24 is exactly 255.255.255.0 and /16 is 255.255.0.0. This is the notation worth learning, because it makes the arithmetic obvious in a way the dotted form does not.
The host count follows directly from the number of zero bits. A /24 leaves eight host bits, so two to the eighth, or 256 addresses. A /25 leaves seven, giving 128. Each additional bit in the prefix halves the network, which is why the useful sizes are always powers of two and why the mask cannot be an arbitrary number.
The masks that are not multiples of eight are the ones people find awkward, because they split an octet. A /26 has two host bits beyond the third octet boundary, giving networks of 64 addresses, and its dotted mask is 255.255.255.192 — where 192 is the first two bits of the final octet set. Converting the octet to binary makes it immediately legible: 192 is 11000000.
The two addresses you cannot use
Every subnet loses two addresses to reserved purposes, which is why a /24 offers 254 usable hosts rather than 256.
The first address in the range, with all host bits set to zero, is the network address. It names the subnet itself and appears in routing tables rather than on an interface. For 192.168.1.0/24 that is 192.168.1.0.
The last address, with all host bits set to one, is the broadcast address. Traffic sent to it is delivered to every host on the subnet. For the same network that is 192.168.1.255. Neither can be assigned to a machine, so the usable range runs from the network address plus one to the broadcast address minus one.
This has a sharp consequence at small sizes. A /30 provides four addresses and therefore two usable hosts, which is exactly enough for a point-to-point link between two routers and is why /30 is the traditional size for one. A /31 provides two addresses and would leave zero usable under the normal rule — which is why a special case exists allowing both addresses on point-to-point links, saving two addresses per link across a large network.
IPv6 does not work this way. It has no broadcast address, using multicast instead, and its address space is large enough that the convention is to allocate a /64 to every subnet regardless of how many hosts it holds. The careful sizing that IPv4 demands is a response to scarcity, not a property of networking.
Working out the range without a calculator
The mental method is worth knowing because it is quick and it makes the underlying structure clear.
Start from the block size, which is 256 minus the value of the octet the mask splits. A /26 has a mask of 255.255.255.192, so the block size is 256 minus 192, which is 64. Networks therefore begin at multiples of 64 in the final octet: 0, 64, 128 and 192.
To locate any address, find which multiple it falls into. The address 192.168.1.100 with a /26 sits between 64 and 128, so its network address is 192.168.1.64, its broadcast is 192.168.1.127, and its usable range is 65 through 126.
The same method works on any octet. A /20 splits the third octet with a mask of 255.255.240.0, giving a block size of 16, so networks begin at third-octet values of 0, 16, 32 and so on, each spanning sixteen full octets of address space — 4,094 usable hosts.
It is worth memorising the small set of block sizes, since they are the only values that ever occur: 128, 64, 32, 16, 8, 4 and 2, corresponding to /25 through /31. Everything else is these patterns applied at a different octet.
Why subnetting is done at all
Dividing a network into smaller ones costs addresses, so it needs a reason, and there are three good ones.
The first is broadcast containment. Broadcast traffic reaches every host on a subnet, and every host must process it. On a very large flat network this becomes a meaningful load, and one misbehaving device can degrade the whole segment. Subnetting bounds the damage.
The second is security and policy. Traffic between subnets passes through a router, which is where filtering can be applied. Putting guest devices, servers and management interfaces on separate subnets makes it possible to control what reaches what. A flat network has no such boundary — anything can reach anything.
The third is organisation and routing efficiency. Contiguous blocks can be summarised into a single routing entry, which keeps routing tables small. This is the whole reason CIDR replaced the old class-based system in the early 1990s: classful addressing forced allocations into fixed sizes of 256, 65,536 or 16.7 million addresses, which wasted enormous ranges and produced routing tables growing faster than hardware could handle.
The reserved private ranges are worth knowing alongside this. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are set aside for internal use and are not routed on the public internet, which is why they appear on essentially every private network. Their differing sizes are why 10.x is typical in large organisations and 192.168.x in homes.