Reading the number after the slash
In 192.168.1.0/24, the number after the slash counts the bits at the start of the address that name the network. An IPv4 address has 32 bits, so whatever's left over belongs to hosts. A /24 leaves 8 host bits, which is 256 addresses. A /26 leaves 6 bits and 64 addresses.
Each extra bit in the prefix cuts a block in half. A /24 splits into 2 blocks of /25 or 4 blocks of /26. The slash is also the subnet mask in short form: 255.255.255.0 is 24 one bits followed by 8 zeros, so it's /24.
Sizes worth knowing by heart
These cover most real networks. The usable count is the total minus the network and broadcast addresses.
- /30: 4 addresses, 2 usable, mask 255.255.255.252. A link between two routers.
- /28: 16 addresses, 14 usable, mask 255.255.255.240. A small server group.
- /24: 256 addresses, 254 usable, mask 255.255.255.0. A typical office or home LAN.
- /22: 1,024 addresses, 1,022 usable, mask 255.255.252.0. A busy site.
- /16: 65,536 addresses, 65,534 usable, mask 255.255.0.0. A whole campus or a cloud network.
Type any prefix into the Subnet Calculator to see its mask, host range and count.
What CIDR replaced
Before CIDR, a block was a Class A (/8), a Class B (/16) or a Class C (/24), with nothing in between. A company with 2,000 devices was too big for a Class C, so it took a Class B and used a small slice of 65,536 addresses. RFC 4632 describes the pressure that ended this: Class B space was running out, and routing tables were growing beyond what routers could manage.
CIDR was built to address those two problems. A block can be any power of two, so that company fits in a /21 with 2,046 usable addresses. A provider can also announce one aggregate route for a whole block of customers instead of one route per customer. CIDR didn't fix running out of IPv4 addresses. That's what IPv6 is for.
Limits you hit in the cloud
AWS allows IPv4 subnets from /16 to /28, and Azure allows /2 to /29. Both keep five addresses in every subnet: the first four and the last one. A /28 has 16 addresses but only 11 for your resources, and a /24 gives 251.
That's why people round up. For 100 servers, a /25 leaves 123 usable addresses in the cloud, since a /26 gives only 59.