Networking / LOCAL TOOL

IP Range to CIDR Converter

Convert address ranges to CIDR blocks and back, aggregate blocks, and find overlaps.

Runs locally — input is never uploaded
An range IP or one block per line
ResultReady when you are

WHAT IT DOES

The blocks that cover a range, and nothing outside it.

A firewall rule, a security group, and an S3 bucket policy all want CIDR blocks, while the range you were given is two addresses. Enter the range to get the shortest list of blocks that covers it exactly, or enter blocks to get the range they span. A list of blocks is aggregated into the fewest that hold the same addresses, and any that overlap each other are reported.

Why use it?

Use it when a policy expects CIDR blocks but you have inclusive address endpoints, or when a long block list may contain overlaps.

How to use this tool

  1. Paste a range such as 192.0.2.0 - 192.0.2.255, or list CIDR blocks on separate lines.
  2. Convert and review the exact covering blocks, overlap notes, and normalized network addresses.
  3. The example range becomes 192.0.2.0/24. For an irregular range, keep every returned block rather than replacing them with a broader parent that would admit extra addresses.

Details and limitations

  • A range becomes one block only when its length is a power of two and it begins on its own boundary. Any other range needs several, and the list produced is the shortest one that covers the range exactly, with no address outside it.
  • Both families are supported, and both ends of a range must be the same one. Address counts for large IPv6 blocks are shown as a power of two as well as in full.
  • Ranges may be written with a hyphen, an en dash, two dots, or the word to. Blank lines and lines starting with # are ignored, so a list can carry its own comments.
  • Adjacent blocks are only merged when they are the two halves of one parent: 10.0.0.128/25 and 10.0.1.0/24 touch, but no single block holds exactly those addresses and nothing else.
  • A block written with host bits set, such as 10.1.2.3/24, is read as its network and the correction is reported rather than applied silently.

WORKED EXAMPLES

Cover only the addresses requested

Convert a range that excludes the first and last addresses of a /24. A whole /24 would be shorter to write, but would include two addresses outside the input.

Inclusive range

192.0.2.1 - 192.0.2.254

Expected result

Fourteen CIDR blocks covering exactly 254 addresses. The first and last are 192.0.2.1/32 and 192.0.2.254/32; 192.0.2.0 and 192.0.2.255 remain excluded.

COMMON QUESTIONS

IP Range Converter questions

Why does my range need more than one CIDR block?
Because a block can only describe a run of addresses whose length is a power of two and which starts on a matching boundary. 192.168.1.5 - 192.168.3.200 satisfies neither, so it is covered by twelve blocks: the converter takes the largest block that fits at each step, which is what produces the shortest possible list.
Can it merge a list of blocks into fewer?
Yes. Paste the blocks one per line and the result is the fewest blocks holding the same addresses. A block already inside another is dropped, and two halves of a parent become the parent, repeatedly, so four consecutive /26s aligned on a /24 collapse to that /24.
How do I check whether two subnets overlap?
Put both on their own lines. Any pair sharing addresses is listed under Overlaps with the addresses they have in common. In a firewall or an ACL an overlap usually means one rule is shadowing another.
Does it work with IPv6?
Yes, including compressed forms such as 2001:db8::/32. IPv4 and IPv6 cannot be mixed in one conversion, because no single set of blocks covers addresses from both families.