What this calculator does
CIDR (Classless Inter-Domain Routing) writes a block of addresses as a starting address and a prefix length, for example 192.168.0.0/23. Firewalls, cloud security groups and routing tables expect blocks in this form. Three jobs come up again and again, and this page does each one:
- Range to CIDR. You have a first and last address, perhaps from a provider or a WHOIS record, and need the blocks that cover exactly that range. An arbitrary range often needs several blocks. The calculator returns the smallest set.
- CIDR to range. You have a block and want to know which addresses are inside it.
- Merge. You have a long allowlist or blocklist. Merging removes blocks that sit inside others and joins neighbours, so the list is shorter and means the same thing.
Everything is calculated in your browser. The lists you paste are not uploaded.
For the network address, broadcast address, masks and host counts of a single subnet, use the subnet calculator.
Why a range can need several blocks
A CIDR block must start on a boundary that matches its size. A block of 4 addresses starts at a multiple of 4, a block of 256 at a multiple of 256. The range 192.168.0.10 to 192.168.0.20 holds 11 addresses and starts at 10, so no single block fits. It becomes four: 192.168.0.10/31, 192.168.0.12/30, 192.168.0.16/30 and 192.168.0.20/32.
Questions
What does the number after the slash mean?
It is the count of leading bits that every address in the block shares. In IPv4 a /24 fixes 24 of 32 bits and leaves 8, which is 256 addresses. Each step down doubles the block: a /23 is 512 addresses, a /22 is 1,024.
Is merging safe for a firewall rule list?
The merged list covers exactly the same addresses as the list you entered, no more and no fewer. Blocks are joined only when together they form one valid block or when one already contains the other.
Can I mix IPv4 and IPv6 in the merge box?
Yes. Each family is merged separately and IPv4 results are listed first.