CIDR ↔ Range
Convert between CIDR and IP ranges and count the addresses covered.
Converting Between CIDR and IP Ranges
CIDR (Classless Inter-Domain Routing) notation like 192.168.0.0/22 bundles a network and its prefix length into a single address block. Firewall rules and access lists, however, often need a plain start-to-end range instead, and sometimes you have an arbitrary range that you need to summarize back into CIDR blocks.
This tool converts in both directions. The top section takes a CIDR and shows the start and end addresses it covers along with the total number of addresses. The bottom section takes a start IP and an end IP and splits that range into the smallest set of CIDR blocks that cover it exactly. Because arbitrary ranges rarely line up with a single block, the result is often several blocks of different sizes.
All conversion happens in your browser and the addresses you enter are never sent to a server, so it is safe to paste production ranges or customer IP blocks.
How to Use
- To turn a CIDR into a range, type it into the top field, for example 192.168.0.0/22. The start-to-end range and total address count appear immediately below.
- To turn a range into CIDR, fill in the start and end fields with IPv4 addresses, for example start 192.168.0.0 and end 192.168.3.255.
- Copy the resulting minimal CIDR block list straight into your firewall or router config. If the start address is greater than the end, an error message is shown.
Frequently Asked Questions
- Why does one range split into multiple CIDR blocks?
- A CIDR block is always a power-of-two size and must begin on an aligned boundary. Arbitrary start and end addresses usually do not satisfy that alignment, so covering the range exactly requires several blocks of different sizes. This tool computes the minimal set, meaning the fewest blocks possible.
- How many addresses does a /22 contain?
- A /22 leaves 10 host bits (32 minus 22), so it contains 2 to the 10th power, or 1,024 addresses. That is the same size as four consecutive /24 networks combined.
- What happens if I enter a non-network address in the CIDR field?
- The top CIDR converter applies the mask to your input and computes the range from the true network boundary. So entering 192.168.0.130/22 still yields the range starting at that block's canonical first address.