IP Range & CIDR Converter

Enter a start and end IP address to get the smallest set of CIDR blocks that exactly covers that range (or a CIDR block to expand back into its first and last address), aggregate a list of CIDR blocks into the smallest equivalent set, and check whether a given IP falls inside a given subnet — all computed entirely in your browser, with nothing ever sent to a server.

Range ↔ CIDR

IP Range & CIDR Converter

This page is for a network engineer who has an arbitrary IP range — from a firewall log, an allowlist request, or a cloud provider's published address block — and needs it expressed as CIDR, or the other way around. Not every range is a single CIDR block: a CIDR block's size must be a power of two and its start address must land on a matching boundary, so an arbitrary range like 203.0.113.10–203.0.113.37 (28 addresses, starting mid-block) needs several differently-sized blocks stitched together to cover it exactly, with none left uncovered and none extending past either end.

The converter above finds the minimal such set by always taking the largest block that both starts exactly at the current position and still fits before the range's end, then repeating from where that block left off. For 203.0.113.10–203.0.113.37 that yields 5 blocks (.10/31, .12/30, .16/28, .32/30, .36/31) rather than 28 separate /32 host routes — the same minimal-cover principle a router uses when compressing a route table, and the same reason an allowlist expressed as CIDR is usually far shorter than one expressed as a raw address list. A route table, firewall rule set or ACL with fewer, larger entries is both faster to evaluate and easier for a human to audit than one padded with single-host entries.

The aggregation tool below solves a related but different problem: given several CIDR blocks you already have (not a raw range), collapse any that are adjacent or overlapping into fewer, larger blocks. 10.0.0.0/25 and 10.0.0.128/25 are adjacent halves of the same /24 and merge into 10.0.0.0/24; two blocks that merely overlap (say 10.0.0.0/24 and 10.0.0.128/25) merge the same way, keeping only the covering union. A merged interval is rarely itself CIDR-aligned, so the aggregator re-splits each merged span back into minimal CIDR blocks using the same algorithm as the range converter above — the two tools share their core arithmetic, not just their page.

The is-IP-in-subnet checker answers a narrower, very common question directly: "is 10.0.0.130 inside 10.0.0.0/24, and if so, what are that subnet's own network and broadcast addresses?" — useful for quickly confirming a firewall rule or route actually matches the address you expect, including the easy-to-miss edge case where the address under test IS the network or broadcast address itself (still "in subnet", by definition, just not a usable host address).

Aggregate a CIDR list

Paste a small, manually-curated list of CIDR blocks (comma or newline separated) to collapse any overlapping or adjacent entries into the minimal equivalent set. For summarizing a large, pasted list of many addresses at once, see the bulk IP list tool (coming soon).

Is this IP in this subnet?

Enter an IP address and a CIDR block to check whether the address falls inside it, along with that subnet's own network and broadcast addresses.

Glossary

Minimal covering set
The smallest possible list of CIDR blocks that together cover a given address range exactly, with no gap and no address outside the original range included.
Block alignment
A CIDR block's start address must be a multiple of its own size (in addresses) — 10.0.0.64/26 is aligned (64 is a multiple of 64), but a /26-size block starting at 10.0.0.32 is not a valid CIDR block at all.
Adjacent blocks
Two CIDR blocks where one's broadcast address is immediately followed by the other's network address (10.0.0.0/25 and 10.0.0.128/25) — mergeable into one larger block even though they don't overlap.
Route aggregation / summarization
Replacing several smaller, adjacent or overlapping CIDR blocks with fewer, larger ones that cover the same address space — reduces route-table or ACL size without changing which addresses match.
Subnet membership
An address is a member of a subnet if it falls between that subnet's network and broadcast addresses inclusive — this includes the network and broadcast addresses themselves, even though they aren't usable host addresses.

Frequently asked questions

Why does a small range split into several CIDR blocks?
A CIDR block's start address must fall on a boundary that's a multiple of its size, and its size must be a power of two. An arbitrary range rarely starts and ends on such boundaries, so covering it exactly usually needs several differently-sized blocks rather than one.
What's the difference between this and the bulk IP list tool?
This aggregator is for a small, manually-typed or pasted list of CIDR blocks you already have. The upcoming bulk IP list tool is for classifying a large pasted list of individual addresses (private, bogon, CGNAT, etc.) — a different scale and a different question.
Does aggregation ever change which addresses are covered?
No — the aggregated result always covers exactly the union of the input blocks' addresses, never more and never less. It only changes how that same set of addresses is expressed (fewer, larger blocks instead of more, smaller ones).
Is the network or broadcast address itself "in subnet"?
Yes. Subnet membership covers every address from the network address through the broadcast address inclusive — those two boundary addresses just aren't usable host addresses on the subnet.
Does this tool send my ranges or CIDR list anywhere?
No. Every calculation on this page — the range/CIDR converter, the aggregator, and the in-subnet checker — runs entirely in your browser using plain arithmetic; nothing you type here is sent to our servers or anywhere else.
Does the CIDR list support IPv6?
No — the range converter, aggregator and in-subnet checker on this page are IPv4-only; entries that look like an IPv6 address or CIDR block are reported as an error.

API equivalent

The range/CIDR math above is computed entirely on your device — this page makes zero network requests to calculate any result on it. If you'd rather get network/registry facts about a real, routable IP address server-side as part of a larger lookup, the network group of our main API returns the same kind of facts:

curl
curl "https://ip.xakki.pro/api/v1/ip?ip=203.0.113.10&include=network"

Example response (trimmed):

{
  "schemaVersion": 15,
  "status": "ok",
  "ip": "203.0.113.10",
  "version": 4,
  "network": {
    "asn": 65536,
    "prefix": "203.0.113.0/24",
    "registry": "arin"
  }
}

Read the full API docs

Like this tool? Our API gives free accounts 1,000 requests/day.See the API docs →