CIDR / IP Range Converter

Convert IP ranges to the smallest set of CIDR blocks, expand CIDR blocks into first and last addresses, merge overlapping lists and check whether an IP is inside them.

Is this IP inside?

Conversion

1,024 addresses in total
InputFirst addressLast addressAddressesCIDR blocks
10.0.0.0/2410.0.0.010.0.0.25525610.0.0.0/24
10.0.1.0/2410.0.1.010.0.1.25525610.0.1.0/24
10.0.2.0/2310.0.2.010.0.3.25551210.0.2.0/23

Merged (aggregated) CIDR list

{{ result.collapsed|join:"
" }}

What this CIDR converter does

  • Range to CIDR: enter 192.168.0.10 - 192.168.0.200 and get the minimal list of CIDR blocks that covers exactly that range. Firewalls, cloud security groups and routers usually accept only CIDR notation.
  • CIDR to range: enter 10.0.0.0/22 to see its first and last address and how many addresses it contains.
  • Aggregate a list: paste many blocks, one per line, and get a merged list with overlaps and adjacent blocks combined. Handy for allowlists and route summarisation.
  • IP in range check: add an IP address to test whether it falls inside any of the blocks.

Why a range becomes several CIDR blocks

A CIDR block always contains a power-of-two number of addresses and must start on a boundary that is a multiple of its size. An arbitrary range such as .10 to .200 does not line up with those boundaries, so it has to be split into several aligned blocks: .10/31, .12/30, .16/28 and so on. The converter finds the smallest such set. To understand prefixes and masks in depth, read subnet masks and CIDR notation or use the subnet calculator.

Common uses

  • Turning a provider's published IP ranges into firewall rules.
  • Building geo or ASN allowlists from ASN prefix lists.
  • Checking whether a client IP from your logs belongs to a trusted network.
  • Summarising many routes into fewer aggregate announcements.

Frequently asked questions

Does it work with IPv6?

Yes. Ranges, CIDR blocks and the containment check all support IPv6. Separate lists are aggregated per IP version.

How many lines can I enter?

Up to 200 lines per conversion.

Copied to clipboard