Using the calculator
Type a block in CIDR notation, like 10.0.0.0/22, to see the range it covers, its mask and how many hosts it holds. Or type a range, like 10.0.0.0 - 10.0.3.255, and the calculator gives the fewest CIDR blocks that cover exactly that range and nothing more.
A range that doesn't line up with block boundaries needs several blocks. 10.0.0.1 to 10.0.0.6 takes four: 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/31 and 10.0.0.6/32.
What CIDR notation means
The number after the slash is the prefix length: how many leading bits are fixed. 10.0.0.0/22 fixes the first 22 bits and leaves 10 free, so it covers 2¹⁰ = 1,024 addresses, from 10.0.0.0 to 10.0.3.255. A block always starts on a multiple of its own size, which is why some ranges need more than one.
Why it replaced address classes
Before CIDR, networks came in fixed classes, A, B and C, with 8, 16 or 24 network bits. RFC 4632, which in August 2006 replaced the original CIDR document, RFC 1519 from September 1993, names the problems that caused: the Class B space was running out, routing tables were growing beyond what routers and people could manage, and the 32-bit address space itself would eventually run out.
CIDR let networks be any size and let routers combine neighboring blocks into one route, which slowed both problems down.
Worked examples
192.168.0.0 to 192.168.2.255 is 768 addresses. That isn't a power of two, so it can't be one block. The calculator gives two blocks. 192.168.0.0/23 covers the first 512 addresses, up to 192.168.1.255, and 192.168.2.0/24 covers the last 256.
10.0.0.0 to 10.0.0.99 is 100 addresses and needs three. 10.0.0.0/26 takes the first 64, 10.0.0.64/27 the next 32, and 10.0.0.96/30 the last four. Each block is the largest one that starts where the last one ended and doesn't run past the end of the range.
Host bits in a block
10.0.0.5/24 is a common way to write an address and its network together, but as a block it isn't tidy: a block's address has every host bit set to 0. The block that 10.0.0.5/24 sits in is 10.0.0.0/24, and 10.0.0.5 is one host on it. Route tables and firewall rules want the block written the tidy way.
Questions
What does /16 mean?
The first 16 bits are the network, leaving 16 for hosts: 65,536 addresses, the size of an old Class B network.
Why can't any range be one block?
A CIDR block's size is a power of two, and it has to start on a multiple of that size. A range that starts or ends in between needs smaller blocks to fill the gaps.
Sources
Added . Last updated and reviewed . What's new






