IP range to CIDR converter

Paste IP ranges, single addresses or CIDR blocks, one per line. You get the shortest list of CIDR blocks that covers them exactly, plus the start and end of each block.

CIDR blocks

How to IP range to CIDR converter

  1. Enter one item per line: a range such as 10.0.0.5 - 10.0.0.90, a single address, or a CIDR block.
  2. The right-hand box lists the CIDR blocks that cover exactly those addresses.
  3. Click Copy to paste the list into a firewall rule, security group or allow list.

Why a range needs several CIDR blocks

A CIDR block always holds a power of two addresses and starts on a multiple of its size. Most ranges do not line up that neatly, so they have to be covered by several blocks. The range 192.168.1.10 to 192.168.1.80 needs six:

192.168.1.10/31   (2 addresses)
192.168.1.12/30   (4)
192.168.1.16/28   (16)
192.168.1.32/27   (32)
192.168.1.64/28   (16)
192.168.1.80/32   (1)

This tool always finds the shortest possible list.

Where this is useful

  • Firewalls and cloud security groups accept CIDR blocks, not start and end addresses.
  • Allow lists and block lists from a provider often arrive as ranges and need converting.
  • Cleaning up rules. Paste a long list of blocks with merging on to combine neighbors and remove overlaps.
  • Route summarization. Four neighboring /24 networks merge into one /22.

CIDR to range

It works in the other direction too. Enter a block such as 172.16.0.0/22 and the table shows its first and last address and how many addresses it holds.

For masks and usable host counts, open a block in the subnet calculator.

Private by design

This tool runs entirely in your web browser. Nothing you type or paste is sent to a server, logged or stored, so it is safe to use with internal addresses, configuration files and other work data. There is no sign-up and it keeps working offline once the page has loaded.

Frequently asked questions

How do I convert an IP range to CIDR?

Type the first and last address with a dash between them. The CIDR blocks covering that range are listed straight away.

Why does one range give several CIDR blocks?

A CIDR block must hold a power of two addresses and start on a matching boundary. A range that does not fit one block is split into the fewest blocks that do.

Can I merge a list of subnets?

Yes. Paste them one per line and keep merging ticked. Overlapping and neighboring blocks are combined.

Does it support IPv6?

Yes. IPv6 ranges and blocks are handled the same way and listed after the IPv4 results.