IP Block Size Calculator
Calculate the block size (total IP addresses) for any CIDR prefix, or find the smallest CIDR prefix that fits your required number of hosts. Supports CIDR input (/24), block size input (256), and host count input (200 hosts needed). Includes AWS reserved IP guidance.
Hero, guides, and sidebar links below work without JavaScript. The interactive checker needs JavaScript enabled in your browser.
IP Block Sizes — Complete CIDR Reference
An IP block is a contiguous range of IP addresses defined by a CIDR prefix. The block size is always a power of 2: a /24 block has 2⁸ = 256 addresses, a /25 has 128, a /23 has 512. Understanding the relationship between CIDR prefix lengths and block sizes is fundamental to subnet planning, IP allocation, and firewall rule writing.
Every CIDR prefix maps to a power-of-2 block size — halving the block size with each increment in prefix length
CIDR Block Size Reference Table
| CIDR | Block Size | Usable Hosts | Subnet Mask | Use Case |
|---|---|---|---|---|
| /8 | 16,777,216 | 16,777,214 | 255.0.0.0 | Class A private block (10.0.0.0/8), large ISP allocation |
| /16 | 65,536 | 65,534 | 255.255.0.0 | AWS VPC, large enterprise, Class B private |
| /20 | 4,096 | 4,094 | 255.255.240.0 | Medium enterprise site, cloud region subnet |
| /22 | 1,024 | 1,022 | 255.255.252.0 | Large office/campus VLAN |
| /23 | 512 | 510 | 255.255.254.0 | Two merged /24s, medium site |
| /24 | 256 | 254 | 255.255.255.0 | Standard office subnet, AWS /24 gives 251 usable (5 reserved) |
| /25 | 128 | 126 | 255.255.255.128 | Half a /24, 100-host department |
| /26 | 64 | 62 | 255.255.255.192 | Small department, 50-host team |
| /27 | 32 | 30 | 255.255.255.224 | Small segment, server group |
| /28 | 16 | 14 | 255.255.255.240 | Very small segment, AWS minimum recommended |
| /29 | 8 | 6 | 255.255.255.248 | Tiny segment, 6-host max |
| /30 | 4 | 2 | 255.255.255.252 | Point-to-point WAN link (2 routers) |
| /31 | 2 | 2* | 255.255.255.254 | P2P link RFC 3021, no network/broadcast reserved |
| /32 | 1 | 1 | 255.255.255.255 | Single host route, loopback, firewall specific-host rules |
* /31 per RFC 3021 — both addresses usable for point-to-point. Formula: Block size = 2^(32−prefix), Usable = Block size − 2 (except /31 and /32).
How to Choose the Right Block Size
Select the smallest CIDR block that accommodates your required number of hosts: find the smallest power of 2 that is ≥ hosts + 2 (for network and broadcast). For 200 hosts: 200 + 2 = 202, next power of 2 = 256 = /24. For 50 hosts: 52 → next power of 2 = 64 = /26 (62 usable). For AWS, add 5 (not 2) for reserved IPs. Use the calculator above — enter your host count and it selects the optimal CIDR prefix automatically.
Frequently Asked Questions
How many IPs are in a /24 block?
A /24 block contains 256 total IP addresses (2^8 = 256). Of these, 254 are usable for hosts (the network address and broadcast address are reserved). In AWS, a /24 provides only 251 usable IPs because AWS additionally reserves the router address (.1), DNS address (.2), and future-use address (.3) in every subnet.
What is the formula for IP block size?
Block size = 2^(32 − prefix_length). For /24: 2^(32−24) = 2^8 = 256. For /26: 2^(32−26) = 2^6 = 64. For /16: 2^(32−16) = 2^16 = 65,536. Usable hosts = block_size − 2 (subtracting network address and broadcast address). Exception: /31 has 2 usable hosts (no reserved addresses), /32 has 1 address total.
What block size do I need for 100 hosts?
For 100 hosts, you need 100 + 2 = 102 total addresses (network and broadcast reserved). The next power of 2 ≥ 102 is 128 = /25 (126 usable hosts). In AWS with 5 reserved IPs, you need 100 + 5 = 105, so /25 (128 − 5 = 123 usable) still works. If you need room to grow beyond 126, use /24 (254 usable).
What is the smallest AWS subnet I can use?
AWS supports subnet sizes from /16 to /28. The smallest is /28 (16 addresses). After AWS reserves 5 IPs, a /28 provides 11 usable IPs. AWS recommends /24 (251 usable) as the minimum for most workloads to allow for growth and service IP requirements (load balancers, NAT gateways, and endpoints also consume IPs from the subnet).
Is this IP block size calculator free?
Yes — completely free, no signup required. Accepts CIDR prefixes (/24), block sizes (256), or host counts (200) and automatically determines the correct CIDR prefix. All calculations run in your browser.