Skip to content

Calculate minimal valid IPv4 CIDR blocks covering an IP address range.

Loading tool

About IPv4 range expander

Converts an IPv4 start and end address into the smallest list of CIDR blocks that covers exactly that range, and works in reverse: paste CIDR blocks (prefix or netmask notation) to get each block's first address, last address and size. Blocks written with host bits set are normalized to their network address.

Common uses

  • Turn an IP range from a provider or whois record into CIDR for a firewall rule
  • Write an allowlist for a security group or WAF that only accepts CIDR
  • Check the first and last address of a set of CIDR blocks
  • Find out how many addresses a range contains

FAQ

Why does one IP range turn into several CIDR blocks?
A CIDR block must contain a power-of-two number of addresses and start on a matching boundary. A range that does not line up, like 192.168.0.10 to 192.168.1.200, has to be split into several smaller aligned blocks.
How many addresses are in a CIDR block?
2 to the power of (32 - prefix length). A /24 has 256 addresses, a /16 has 65,536 and a /32 is a single address.
Can I enter a netmask instead of a prefix length?
Yes, in CIDR to range mode you can write 10.0.0.0/255.255.252.0, which is the same as 10.0.0.0/22.