Skip to content

Free CIDR & IP Range Calculator

Convert IPv4 or IPv6 ranges to exact CIDRs, merge overlapping network lists and compare containment or intersections. Export precise address counts and calculated blocks privately.

✓ Free to use✓ No sign-up✓ Browser-based

Loading tool…

How to convert IP ranges into CIDRs and merge network lists

Convert inclusive IPv4 or IPv6 ranges into exact CIDRs, aggregate network lists or compare containment. Export the calculated blocks and precise address counts locally.

  1. Choose range conversion, CIDR list aggregation or network comparison.
  2. Enter matching-version range endpoints, paste up to 2000 networks or provide two CIDRs to compare.
  3. Review exact CIDR output, unique address counts and any host-bit normalization. Use strict validation when network boundaries must be explicit.
  4. Copy the result or download TXT, JSON or CSV. Distinguish exact output from a wider enclosing block shown for planning.

Who needs a CIDR and IP range calculator

Network and cloud engineers often receive address ranges as a start and end address, while firewalls, security groups and routing tables expect CIDR blocks. This calculator bridges that gap. It is also useful when building allowlists or blocklists from vendor documents, where ranges overlap or repeat.

Security teams use the merge mode to tidy long lists before loading them into a firewall, which reduces rule counts. Planners use the compare mode to check whether a proposed subnet sits inside a parent network or clashes with an existing one, before it causes a routing problem.

The calculator supports IPv4 and IPv6, uses exact whole-number arithmetic, and can export results as text, JSON or CSV.

Worked example: converting a range

Enter 192.0.2.10 as the start and 192.0.2.200 as the end. The range is not aligned to a single block, so the tool splits it into eight exact CIDRs: 192.0.2.10/31, 192.0.2.12/30, 192.0.2.16/28, 192.0.2.32/27, 192.0.2.64/26, 192.0.2.128/26, 192.0.2.192/29 and 192.0.2.200/32.

Their sizes are 2 + 4 + 16 + 32 + 64 + 64 + 8 + 1 = 191 addresses, which matches 200 - 10 + 1. The smallest enclosing block is 192.0.2.0/24 with 256 addresses, so the tool notes that it includes 65 extra addresses not in your range.

In merge mode, the sample list 192.0.2.0/25, 192.0.2.128/25 and 192.0.2.64/26 collapses to 192.0.2.0/24, and 2001:db8::/64 with 2001:db8:0:1::/64 becomes 2001:db8::/63. Comparing 10.0.0.0/16 with 10.0.32.0/20 reports that the first network contains the second, with 4,096 overlapping addresses.

How the calculation works

A CIDR block is a prefix length that fixes the leading bits of an address. A /24 in IPv4 leaves 8 bits free, so it holds 2 to the power of 8, or 256 addresses. A block must start on a boundary that is a multiple of its size. To cover an arbitrary range, the tool repeatedly picks the largest block that starts at the current address and does not pass the end.

Merging sorts the blocks, joins overlapping and adjacent ones, and re-splits the union into the fewest exact blocks. Nothing outside the input is added. IPv4 and IPv6 entries are processed separately, and the merge mode accepts up to 2,000 entries.

Compare mode reports one of five outcomes: identical, first contains second, second contains first, disjoint, or different IP versions. The output then shows the intersection, if any.

Common mistakes to avoid

Mixing versions in range mode will fail, since both endpoints must be IPv4 or both IPv6. Another trap is entering a block with host bits set, such as 192.0.2.7/24. By default the tool quietly normalizes it to 192.0.2.0/24 and tells you. Turn on strict validation if that would hide a typo you need to fix.

Do not paste the enclosing block into a firewall when you only meant to allow your exact range, since it can open extra addresses. Use the exact output. When importing a CSV into a spreadsheet, watch for huge IPv6 counts being rounded, and keep the JSON export when exact counts matter.

Useful tips and limitations

  • IPv4 and IPv6 entries in a list are aggregated separately.
  • JSON retains very large address counts as strings; spreadsheet imports can round large numeric values.
  • Add notes after a # sign in merge mode to label where each block came from, since comments are ignored during calculation.
  • Use the display limit selector to show more table rows, as downloads always include every calculated block.

Common questions

Does CIDR aggregation add addresses that were not in the input?

The exact output does not. It combines adjacent or overlapping blocks only when their full union can be represented without adding gaps.

Why can the smallest enclosing block include extra addresses?

A single enclosing CIDR covers both extremes, including gaps between them. Extra addresses are reported separately and are not part of the exact output.

Can I paste individual addresses with network blocks?

Yes. A single IPv4 address is treated as /32 and a single IPv6 address as /128. Lists can use whitespace or commas, and # starts a comment.

What does strict host-bit validation change?

Normally an input such as 192.0.2.7/24 is normalized to 192.0.2.0/24 and reported. Strict validation rejects it instead.

Are reserved or private addresses removed from the counts?

No. Counts describe the full mathematical coverage of each block, including special, reserved and documentation addresses.

Is an IPv4-mapped IPv6 address treated as IPv4?

No. IPv4 and IPv4-mapped IPv6 addresses are handled as separate address families.

Why does a single address show up as /32?

A /32 in IPv4, or /128 in IPv6, is a block of exactly one address, so a lone address is stored that way.

Your input is processed in your browser without a ToolWorld Online account. Copy or download anything you want to keep before leaving the page.

Read our privacy policy · About ToolWorld Online