IP Range Calculator

Calculate IP range details: number of IPs, CIDR blocks covering the range, subnet mask. Or enter IP + hosts needed to get the smallest CIDR block. IPv4 only.

Mode

IPs in range
256
Single subnet (CIDR)
192.168.1.0/24
CIDR blocks covering range

IP Range to CIDR Conversion

Converting an IP range to CIDR blocks finds the minimal set of subnets that exactly cover the range. This is useful when firewall rules or routing tables only accept CIDR notation, not arbitrary ranges. The algorithm works by repeatedly taking the largest possible CIDR block that starts at the current address and fits within the range, then advancing to the next uncovered address.

For example, the range 10.0.0.0 to 10.0.0.255 is a single /24 block. The range 10.0.0.0 to 10.0.0.127 might be 10.0.0.0/25. Non-aligned ranges like 10.0.0.5 to 10.0.0.20 require multiple blocks.

Sizing Subnets for Host Count

When you need to allocate a subnet for a known number of hosts, you want the smallest CIDR that fits. Remember that two addresses (network and broadcast) are reserved. For 50 hosts you need 52 total addresses; the smallest power of 2 that fits is 64, so a /26 (64 addresses, 62 usable) works. For 100 hosts you need 102; a /25 (128 addresses, 126 usable) is the smallest.

Always round up: if you need 30 hosts, a /27 (32 addresses, 30 usable) is correct. A /28 (16 addresses, 14 usable) would be too small.

Use Cases for IP Range Calculations

Network engineers use IP range calculators when planning address allocation, writing firewall rules that allow or deny ranges, configuring load balancers or proxy allowlists, and documenting network topology. Cloud providers often require CIDR blocks for VPC subnets; converting a desired range to CIDR ensures compatibility. Security teams use it to translate "allow 10.0.1.0–10.0.1.63" into the equivalent CIDR 10.0.1.0/26 for ACL configuration.

Frequently Asked Questions

Related Tools

Explore More Tools

Find this tool useful? Buy us a coffee to keep DuskTools free and ad-light.