IP Range to CIDR

Convert IP ranges to the smallest CIDR list, and CIDR back to ranges.

About this tool

Enter one range per line, such as 192.168.1.10 - 192.168.1.100, and get the exact CIDR blocks that cover it. Switch modes to turn CIDR blocks back into first address, last address and count, with a warning when host bits are set. IPv6 with :: shorthand works too.

How ranges become CIDR blocks

CIDR notation (192.168.1.0/24) describes a block of addresses that shares its first N bits, and its size is always a power of two aligned to that size. Firewalls, cloud security groups, VPN routes, allow-lists and GeoIP databases mostly accept CIDR rather than startโ€“end ranges. An arbitrary range usually needs several blocks. The converter works greedily, at each step taking the largest aligned block that fits inside the remaining range. That produces the minimum number of blocks: 192.168.1.10โ€“192.168.1.100 needs 7, while 10.0.0.0โ€“10.0.3.255 is exactly one /22. The results match Python's ipaddress.summarize_address_range for both IPv4 and IPv6. Addresses are handled as 128-bit integers with BigInt, so IPv6 is exact. Expanding a CIDR shows the network's first and last address and size. If you typed an address with host bits set, such as 10.0.0.5/22, it tells you the real network is 10.0.0.0/22. Honest limits: counts include network and broadcast addresses, so usable IPv4 hosts are usually two fewer. Some platforms cap the number of rules, so very wide ranges may need summarising differently. The subnet calculator and the IP address converter are related.

Frequently asked questions

How do I convert an IP range to CIDR?

Enter start - end here. The tool lists the fewest CIDR blocks that exactly cover the range.

How many addresses are in a /24?

256 (2^8). A /22 has 1,024 and a /16 has 65,536.

Does it support IPv6?

Yes, including :: shorthand, using exact 128-bit arithmetic.

Is anything uploaded?

No. Everything runs in your browser and nothing is stored or sent.