Checking…
CIDR calculator
Convert ranges, merge networks or split prefixes with exact IPv4 and IPv6 arithmetic.
Checking…
Convert ranges, merge networks or split prefixes with exact IPv4 and IPv6 arithmetic.
Checking…
Checking…
Local IPv4 and IPv6 arithmetic. Your inputs stay in this tab.
Ready. Choose an operation and enter your addresses.
Use the CIDR calculator for ranges, aggregation and splitting
An address list is easier to review when its boundaries are explicit. This CIDR calculator converts an inclusive IP range into the smallest exact set of network prefixes, combines overlapping or adjacent networks without filling gaps, and divides a parent network into equal smaller blocks. Choose the operation above, enter your values, and select Calculate. Both IPv4 and IPv6 are supported.
The CIDR calculator runs in your browser after the page and its code load. It does not contact the addresses you enter or submit the calculation to an API. Inputs are kept in the current tab, rather than added to the URL or saved as calculation history. Clear removes the current inputs and results. Changing an input removes the previous answer so an old result cannot appear to describe a new range.
Choose the existing subnet calculator when you want one network's mask, wildcard, conventional IPv4 broadcast address or host boundaries. Use this CIDR calculator when the question involves an arbitrary interval, several existing prefixes, or a subdivision. These are related tasks, but a single subnet mask cannot describe every possible contiguous interval exactly.
Select Range to CIDR and enter the first and last address. Both endpoints are included and must belong to the same address family. The CIDR calculator rejects a reversed range instead of swapping its endpoints silently. A range consisting of one IPv4 address produces a /32; one IPv6 address produces a /128. Neither case requires enumerating any hosts.
For example, enter 192.0.2.10 through 192.0.2.20. The CIDR calculator returns 192.0.2.10/31, 192.0.2.12/30, 192.0.2.16/30, and 192.0.2.20/32. Their sizes are two, four, four and one address, for a total of eleven. The first block begins exactly at the requested start and the final block ends exactly at the requested finish.
This example needs four prefixes because each block must have a power-of-two size and an aligned starting address. A single covering subnet would add addresses outside the requested interval. The CIDR calculator chooses exact coverage instead. This is useful when preparing an address inventory or reviewing an allowlist, where accidentally including neighboring addresses would change the meaning of the list.
Select Aggregate CIDRs and paste one address/prefix per line. Blank lines are ignored. The CIDR calculator accepts up to 256 nonempty lines and 16,384 characters per calculation. Use IPv4 or IPv6 in a given list, not both. Invalid entries stop the complete operation and identify the source line; they are never silently omitted from an otherwise successful answer.
Try 192.0.2.0/25 and 192.0.2.128/25. Together, they cover every address in 192.0.2.0/24, so the CIDR calculator combines them. Adding a duplicate or a smaller prefix already contained in those networks does not increase the address total. Aggregation describes the union of the supplied networks, counting each distinct address once.
Alignment still matters. The adjacent networks 192.0.2.64/26 and 192.0.2.128/26 cannot become one /25 without adding addresses. The CIDR calculator therefore keeps both. Similarly, 192.0.2.0/26 and 192.0.2.128/26 remain separate because an unlisted interval lies between them. A shorter result is useful only when it preserves the original coverage.
If you enter 192.0.2.12/25, the prefix describes the containing network 192.0.2.0/25. The CIDR calculator clears the host bits and displays a normalization notice with the original input and resulting network. Open that notice before copying. An address/prefix does not mean a range beginning at that host; use Range to CIDR when you intend specific inclusive endpoints.
Select Split a CIDR, enter the parent network, and give the new prefix length as digits. The new length must be at least the parent's length and no greater than 32 for IPv4 or 128 for IPv6. The CIDR calculator supports the same length too, which returns the normalized parent as a single block rather than an error.
For 192.0.2.0/24 split into /26 networks, the CIDR calculator returns four children: 192.0.2.0/26, 192.0.2.64/26, 192.0.2.128/26, and 192.0.2.192/26. Each contains 64 mathematical addresses. The children do not overlap, and their combined coverage equals the parent. The operation does not reserve gateway addresses or allocate the networks on a device.
The IPv6 example button fills 2001:db8::/48 and a new length of 64. The CIDR calculator produces 65,536 child prefixes, each containing 18,446,744,073,709,551,616 addresses. Those large totals are exact decimal integers. Results are calculated in pages of 50 blocks, so the browser does not need to build the entire list before displaying the first useful result.
The summary shows the address family, total distinct addresses and number of result blocks. Each row includes a canonical prefix and its inclusive first and last addresses. The CIDR calculator sorts blocks numerically by their starting address. Text sorting would place some dotted IPv4 strings in the wrong order; numeric ordering follows the underlying address values.
Total addresses means all values represented by the result, including values that may have special roles on an actual network. The CIDR calculator does not subtract network or broadcast addresses. It also does not claim that all listed addresses are assignable to ordinary hosts. Device behavior, link type, allocation policy and protocol rules determine how a real network uses that space.
For an inventory, keeping the complete interval is usually the relevant operation. For a host deployment, review the separate subnet calculator and the equipment's documentation. A CIDR calculator can confirm a numerical boundary, but it cannot decide which address your gateway should use or whether an existing DHCP pool, VPN pool or container network overlaps your proposed assignment.
First page, Previous, Next and Last page move through a large result. The Go to page field also accepts an exact decimal page number, including values beyond ordinary JavaScript number precision. The CIDR calculator validates that number against the available pages. It does not wrap an invalid number, round it, or jump to an unrelated part of the result.
Range and aggregation results offer Copy all CIDRs, including blocks outside the visible page. Split results offer Copy page CIDRs and copy only the currently displayed children. The CIDR calculator uses one prefix per line and reports success after the browser's clipboard write succeeds. Check the page indicator before sharing a split list; a single copied page is not the complete subdivision.
IPv6 arithmetic uses all 128 bits. Compressed input such as 2001:db8:: does not shorten the numerical address space. The CIDR calculator formats results with compressed hexadecimal notation and shows full decimal counts, avoiding rounded scientific notation. The IPv6 format guide explains how omitted zero groups relate to the expanded representation.
For mathematical consistency, the CIDR calculator keeps an IPv4-mapped IPv6 input such as ::ffff:192.0.2.1 in the IPv6 family. A /120 containing that address becomes ::ffff:c000:200/120. If you intend a 32-bit IPv4 calculation, enter 192.0.2.1 and an IPv4 prefix instead. This differs from interpreting a mapped socket address as an observed IPv4 connection.
The range operation advances from the first address using the largest aligned block that fits inside the remaining interval. Aggregation first joins overlapping or adjacent numerical intervals, then applies the same covering process. Splitting calculates a child's offset directly from its index. These choices let the CIDR calculator describe enormous networks without attempting to list every individual address.
Input limits keep processing predictable. The CIDR calculator accepts complete dotted-decimal IPv4 and standard IPv6 addresses, with a prefix where required. It rejects hostnames, URLs, ports, bracketed addresses, zone identifiers, abbreviated IPv4, hexadecimal IPv4 and IPv4 octets with leading zeros. Prefix lengths use ordinary decimal digits. Remove spreadsheet headings and comments before pasting a network list.
Mathematical validity is separate from routing, registration and access policy. The CIDR calculator does not check whether an address is online, allocated to you, announced in BGP or permitted by a firewall. Private, documentation, multicast and other special-use ranges can all be calculated. A valid result does not turn those ranges into ordinary public unicast space.
Before replacing several firewall rules with an aggregate, check their actions, priorities and other conditions. The CIDR calculator sees address coverage only. Two rules may target neighboring networks while granting different permissions. Combining their addresses without preserving those differences could change access. Likewise, aggregation alone does not justify advertising a route or prove that a provider will accept it.
The calculation itself needs no network request after loading. Loading the site still involves normal website delivery, and browser extensions or clipboard recipients remain outside this tool's control. The CIDR calculator clears local state on page exit and does not provide persistent history. Save any deliberately selected output yourself if you need to continue a planning session later.
No. Its size must be a power of two and its first address must align with that size. The CIDR calculator returns several prefixes when those requirements are not met. This preserves exactly the requested interval. Use the first and last columns to inspect the boundaries instead of assuming that a visually simple range must also have a single-prefix representation.
There may be gaps, unequal sizes or an alignment boundary that prevents a further exact merge. The CIDR calculator does not include extra addresses to make the answer shorter. Compare neighboring rows and the supplied inputs. If you really intend a wider allocation, define that wider interval explicitly rather than interpreting this result as a routing error.
The CIDR calculator computes only the requested page, even for ::/0 split into /128 blocks. The total describes the complete mathematical result, while the list contains at most 50 rows. There is no bulk export of every child of such a split. Choose a practical prefix size for your actual planning task and copy the pages you need.
Treat the CIDR calculator as arithmetic evidence within your plan. Confirm ownership, existing allocations, routing, device constraints and rollback steps separately. The CIDR notation guide explains prefix boundaries, while IP lookup and ASN lookup answer different registration and routing questions. None of these observations grants authority to use someone else's address space.
The terminology underlying this CIDR calculator follows the classless addressing model described in RFC 4632 and the address and prefix representations described in RFC 4291. These references define addressing concepts; they do not certify this implementation. For additional checks, visit the IP tools directory and read the site's methodology.