CIDR stands for Classless Inter-Domain Routing. The number after the slash says how many bits of the address identify the network; the rest is available for hosts inside it.
An example
In 192.168.1.0/24 the first 24 bits fix the network. Eight bits remain, so 256 addresses: 192.168.1.0 through 192.168.1.255. The first of those is the network address and the last is the broadcast address, leaving 254 usable hosts.
How it scales
- /24 — 256 addresses, 254 usable — a typical office network
- /25 — 128 addresses, 126 usable
- /30 — 4 addresses, 2 usable — enough for one link between two routers
- /32 — a single address
Every step halves it
One more bit on the network side means half as many addresses. Going from /24 to /25 goes from 256 to 128. That is the whole rule; the rest is addition.
IPv6 works differently
IPv6 subnets are so large that the address count is rarely interesting. A /64 is the standard size for one network segment and holds 18 quintillion addresses. The question there is not how many hosts fit, but how many /64s you can cut from your allocation.