IP Block Size Calculator
Calculate how many IP addresses and usable hosts are in any IPv4 CIDR block. Enter a prefix (e.g. 24) or CIDR (e.g. 192.168.0.0/24). Runs in your browser.
Calculate Block Size
Enter CIDR prefix (e.g. 24 or 192.168.0.0/24), then click Get size.
Result
| CIDR | /24 |
|---|---|
| Total addresses | 256 |
| Usable host addresses | 254 |
How Many IPs in a CIDR Block?
For an IPv4 prefix length n (e.g. /24), the total number of addresses in the block is 2^(32-n). So /24 gives 2^8 = 256 addresses; /20 gives 2^12 = 4,096; /16 gives 2^16 = 65,536. In most subnets, two addresses are reserved: the network address (first) and the broadcast address (last). So usable hosts = 2^(32-n) - 2. For /24 that is 254; for /30 that is 2. /31 and /32 have special rules (point-to-point, single host). Our subnet calculator computes this for any IP and CIDR.
The CIDR calculator explains prefix length and subnet mask. The IP range calculator gives the start and end IP of a block; the network address calculator and broadcast address calculator cover the first and last addresses. For listing every IP use IP range generator. Validate IPs with IP address validator.
Common Block Sizes
/32: 1 address (single host). /31: 2 addresses (point-to-point, no broadcast). /30: 4 addresses, 2 usable (often used for point-to-point links). /29: 8 addresses, 6 usable. /28: 16 addresses, 14 usable. /24: 256 addresses, 254 usable (very common for LANs). /16: 65,536 addresses. /8: 16.7 million. This tool shows the exact count for any prefix. For private vs public ranges see private vs public IP checker; for class see IP class finder.
Why Block Size Matters
When you design subnets, plan VPCs, or write firewall rules, knowing the exact size of a block avoids over- or under-allocation. Our calculators help you move between CIDR, subnet mask, network/broadcast, and host count. For geolocation of an IP in a block use IP lookup; for connectivity use ping test and traceroute.
FAQs
How many hosts in a /24?
A /24 has 2^8 = 256 addresses. Subtract 2 (network and broadcast) = 254 usable host addresses.
How do I calculate the number of IPs in a block?
For prefix length n, total addresses = 2^(32-n). Usable hosts = 2^(32-n) - 2 for most subnets (subtract network and broadcast).
What is the largest IPv4 block?
A /0 would be the whole IPv4 space (2^32 addresses). Practically, /8 (e.g. 10.0.0.0/8) gives 16.7 million addresses.
How many /24s fit in a /16?
A /16 has 2^16 = 65,536 addresses. A /24 has 256. So 65,536/256 = 256 /24 subnets fit in one /16.