IP Range Calculator (CIDR ↔ Range)
Turn a CIDR block into its first and last IP, host count and masks, or turn any IPv4 start–end range into the smallest list of CIDR blocks.
Firewall rules, cloud security groups, VPN routes and allow-lists are written either as CIDR blocks (10.0.0.0/22) or as start–end ranges. This calculator converts in both directions for IPv4: give it a CIDR block and it lists the first and last address, usable hosts, subnet and wildcard masks; give it a range and it finds the smallest set of CIDR blocks that covers exactly those addresses — nothing more, nothing less.
How to use this tool
- Type a CIDR block (192.168.1.0/24), an address with a mask (192.168.1.0 255.255.255.0) or a range (10.0.0.5 - 10.0.0.90).
- For a range in one subnet you can shorten the end, as in 10.0.0.5-90.
- Read the range, address counts and masks; for a range, copy the CIDR list.
- Read address-type notes as a partial special-use lookup; actual allocation and routability are not checked.
Formula
Addresses in a /p block = 2^(32 − p). Network = IP − (IP mod 2^(32 − p)); last address = network + 2^(32 − p) − 1.
For ordinary unicast subnets, conventional host capacity = total − 2, because the first address names the network and the last is the broadcast address. /31 links use both addresses (RFC 3021) and /32 is a single host. To split a range, the calculator repeatedly takes the largest aligned power-of-two block that starts at the current address and does not pass the end.
Example
The range 192.168.1.10 – 192.168.1.100 holds 91 addresses. No single CIDR block fits it exactly, so it splits into 7 blocks: 192.168.1.10/31, .12/30, .16/28, .32/27, .64/27, .96/30 and .100/32 (2 + 4 + 16 + 32 + 32 + 4 + 1 = 91). Entering 172.16.5.77/20 instead shows the block 172.16.0.0 – 172.16.15.255 with 4,094 usable hosts.
Frequently asked questions
How many IP addresses are in a /24, /16 or /8?
A /24 has 256 addresses (254 usable hosts), a /16 has 65,536 and a /8 has 16,777,216. Each step of one in the prefix halves or doubles the size.
Why does my range need several CIDR blocks?
A CIDR block must start on a multiple of its own size. A range like .10 to .100 starts and ends off those boundaries, so it is covered by a mix of smaller blocks.
What is a wildcard mask?
The inverse of the subnet mask (255.255.255.255 minus the mask), used in Cisco ACLs and OSPF. For a /24 it is 0.0.0.255.
Does it support IPv6?
No, this tool is IPv4 only. IPv6 uses the same prefix idea, but with 128-bit addresses.
Sources
Last updated: 2026-10-30