IP Range to CIDR Converter

Turn IP ranges into CIDR blocks, CIDR blocks into ranges, or merge a list into the fewest blocks (handy for firewall rules and allow-lists). One entry per line.

Ranges can be written a.b.c.d - e.f.g.h, a.b.c.d-h or with "to".

IPv6 Address Expander / Compressor

Converting an IP range to CIDR

Firewalls, cloud security groups and allow-lists usually want CIDR blocks, not ranges. A range only fits in one block when it starts and ends on the right boundaries, so 192.168.1.10 – 192.168.1.75 becomes several blocks: 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/29 and 192.168.1.72/30. The converter works this out for you, and its merge option joins overlapping or neighbouring entries so your rule list stays as short as possible.

Shortening IPv6 addresses

IPv6 addresses can be shortened by dropping leading zeros in each group and replacing the longest run of all-zero groups with :: (once only). So 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329. Both forms mean exactly the same address; the expanded one is easier to compare and sort, and is what reverse DNS (ip6.arpa) uses.

CIDR or subnet mask?

They're two ways of writing the same thing: /24 is 255.255.255.0, /30 is 255.255.255.252. To see the mask, usable hosts and broadcast address for any block, or to split it into smaller ones, use the Subnet Calculator.

More free tools