CalcWorldHub
Free online calculator · no signup

IPv4 address range to CIDR calculator

Cover an inclusive IPv4 address interval with aligned CIDR blocks without adding addresses outside the interval.

4,000 tools
IPv4 address range to CIDR calculator — First IPv4 address, Last IPv4 address and calculation method
IPv4 address range to CIDR calculator: inputs and calculation method.

How to use this calculator

Cover an inclusive IPv4 address interval with aligned CIDR blocks without adding addresses outside the interval.

  1. Enter First IPv4 address, Last IPv4 address. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Original calculation guide

IPv4 address range to CIDR explained

The interval is covered with the largest address-aligned power-of-two blocks that fit the remaining range. This greedy cover preserves the exact first and last addresses, even when several CIDR prefixes are needed.

Exact CIDR cover192.168.1.0/24
Exact CIDR cover: 192.168.1.0/24 in the worked scenario below.

How the calculation works

Repeatedly choose the largest aligned power-of-two block contained in the remaining inclusive address range.

Inputs and units

First IPv4 address
Inclusive lower endpoint in dotted decimal.
Last IPv4 address
Inclusive upper endpoint in dotted decimal.

Limits of this model

It covers address numbers, including reserved and network/broadcast addresses. It does not validate routability or allocate usable hosts.

The subnet planner expands one given prefix. This tool works in reverse from arbitrary first and last addresses.

Check a numerical scenario

First IPv4 address = 192.168.1.0; Last IPv4 address = 192.168.1.255.

  • Exact CIDR cover: 192.168.1.0/24
  • CIDR blocks: 1 blocks
  • Addresses covered: 256 addresses

The inputs above are an illustrative scenario. Display values are rounded after the calculation.

Frequently asked questions

Does it exclude network and broadcast addresses?

No. The requested numeric interval is covered exactly.

Can one arbitrary range need several blocks?

Yes. CIDR blocks must be aligned powers of two.

Does this aggregate existing disjoint routes?

No. The input is one continuous inclusive interval.

How do I use the IPv4 address range to CIDR calculator?

Enter First IPv4 address, Last IPv4 address. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of IPv4 address range to CIDR?

First IPv4 address = 192.168.1.0; Last IPv4 address = 192.168.1.255. Exact CIDR cover: 192.168.1.0/24 CIDR blocks: 1 blocks Addresses covered: 256 addresses The inputs above are an illustrative scenario. Display values are rounded after the calculation.