Networking

IPv4 Range to CIDR Converter

Convert IPv4 address ranges into the exact minimal list of CIDR blocks, with no extra address: merging, masks, Cisco wildcard masks and exports.

Prepare firewall rules, access control lists or security groups: enter one range per line, check the preview, then convert to CIDR blocks that cover your ranges exactly.

Input

IPv4 Range to CIDR Converter

One first-last range or single address per line; at most 256 lines.

Processing

Ranges that overlap or touch are joined before the conversion.

Each line is converted on its own, in order; duplicates and overlaps are reported.

Changes the display, copy and TXT without a new calculation.

Preview

Enter ranges, then select “Convert”.

Enable JavaScript to convert the ranges locally in your browser.

Results

Enter ranges, then select “Convert”.

Frequently asked questions

How is this different from a covering CIDR prefix?

This converter covers every range exactly, with no extra address: 10.0.0.0-10.0.0.2 gives 10.0.0.0/31 and 10.0.0.2/32. A covering prefix, like the one from the Supernetting calculator, covers everything with one block (10.0.0.0/30) but adds 10.0.0.3.

Why does one range give several blocks?

A CIDR block holds a power of two of addresses and starts on a multiple of its size. Any range therefore splits into several blocks, at most 62 in IPv4; the tool always gives the smallest possible number of blocks.

What happens to ranges that overlap or touch?

By default they are merged: two ranges touch when the end of one plus 1 is the start of the other. With separate lines, each line is converted on its own; the sum of the line sizes can then exceed the number of unique addresses.

What is the Cisco wildcard mask for?

Cisco access control lists use a wildcard mask, the complement of the network mask: a /24 has the mask 255.255.255.0 and the wildcard mask 0.0.0.255. The chosen display also applies to the copy and the TXT file.

Are private or reserved addresses excluded?

No. Ranges are converted as typed: private, public, reserved, documentation or multicast addresses are neither removed nor flagged. Check for yourself that a rule does not target an unexpected range.

What are the limits of the tool?

At most 256 non-empty lines and 16,384 characters, one first-last range or address per line, with no CIDR input. The screen shows the first 1,000 blocks; copy, TXT and CSV always contain every block.

Back to tools home