How this calculator works
A CIDR prefix selects leading network bits in a 32-bit IPv4 address. CIDR-to-range mode clears host bits and includes all addresses in the block. Range-to-CIDR mode repeatedly chooses the largest aligned power-of-two block that stays within the requested endpoints. Its table covers the range exactly without including outside addresses.
Formula
Addresses in /p = 2^(32-p); network = floor(address / block size) x block size; last = network + block size - 1.
Worked example
192.168.1.10/24 belongs to 192.168.1.0 through 192.168.1.255, 256 addresses. The range 192.168.1.1 through 192.168.1.2 needs two /32 blocks because a /31 must start on an even address.
Advertisement
Frequently asked questions
Does the address count exclude broadcast and network addresses?
No. This page describes the complete range. The IP subnet calculator separately reports conventional usable hosts.
Can an arbitrary range be one CIDR block?
Only if its size is a power of two and its starting address is aligned to that size.
Does this support IPv6?
This tool handles IPv4. The IP address converter has separate IPv6 number conversion.