~/tools / cidr-range
// networking

CIDR ↔ IP Range Converter

One entry per line. A CIDR (10.0.0.0/22) expands to its first and last address; a range (10.0.0.5 - 10.0.1.20) collapses into the smallest set of CIDR blocks that covers it exactly.

● runs 100% in your browser — nothing is uploaded

Result

Why convert ranges to CIDR?

Firewalls, routers and cloud security groups usually accept subnets, not arbitrary ranges. To allow 192.168.1.10 – 192.168.1.75 you need the exact set of aligned blocks that covers those addresses and nothing else — here that is 192.168.1.10/31, /30, /28, /27, /29, /30. Doing it by hand is slow and error-prone.

How the algorithm works

Starting from the first address, the converter picks the largest block that is both aligned on its own size and does not overshoot the end of the range, emits it, and moves to the next address. The result is always the minimal list of CIDRs.

Accepted formats

  • 10.0.0.0/22 or 10.0.0.0/255.255.252.0
  • 10.0.0.5-10.0.0.9, 10.0.0.5 - 10.0.0.9, 10.0.0.5 10.0.0.9
  • A single address is treated as a /32