IP Range to CIDR Converter

Many firewalls, cloud security groups and allowlists only accept CIDR notation, while vendors and ISPs often give you a start and end address. Paste one range per line, such as 203.0.113.10 - 203.0.113.80, and get the smallest set of CIDR blocks that covers exactly those addresses, nothing more.

Calculator

Every calculation runs in your browser. What you type never leaves this device.

Features

  • Exact cover: no address outside your range is included

  • The fewest possible blocks, largest first

  • Paste many ranges at once, one per line, written with a dash or the word to

  • A CIDR on its own line is kept as a block, so mixed lists work

  • Copy or download the result as a plain list

Where ranges need to become CIDRs

Firewall and security group rules

AWS security groups, Azure NSGs and most firewalls take CIDRs. Convert a partner's address range before adding the rule.

Allowlisting a payment or SMS provider

Gateways and webhook senders often publish start and end addresses. Turn them into blocks for your server or Nginx allow rules.

Geo or ISP blocklists

Convert range lists from registries and threat feeds into CIDRs that iptables, nftables or Cloudflare rules accept.

Why one range can need several blocks

CIDR blocks have to line up

A CIDR block always holds a power of two addresses and must start on a multiple of its size. 10.0.0.0 to 10.0.0.255 is one tidy /24, but 10.0.0.1 to 10.0.0.10 is not: it becomes 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/30, 10.0.0.8/31 and 10.0.0.10/32. Using a single larger block instead would let in addresses you did not mean to allow.

Tips

  • Write each range as first - last, for example 192.168.0.10 - 192.168.0.99.
  • If a provider's list includes the network and broadcast addresses, it usually lines up into a few large blocks.
  • Use the subnet calculator to check what any single block covers.

IP Range to CIDR Converter - FAQ