Networking

IPv4 Range to Exact CIDR Blocks Calculator

Decompose a continuous inclusive IPv4 range into aligned CIDR blocks without adding outside addresses.

How the calculation works

Addresses in inclusive range = ipv4_number(end)-ipv4_number(start)+1 addresses. CIDR block count = ipv4_range_blocks(start,end) blocks. Exact CIDR decomposition = ipv4_range_cidrs(start,end) .

Worked example

Example inputs — First IPv4 address included: 192.168.1.0; Last IPv4 address included: 192.168.1.255. Expected results — Addresses in inclusive range: 256 addresses; CIDR block count: 1 blocks; Exact CIDR decomposition: 192.168.1.0/24.

Assumptions and limits

Offline planning arithmetic: this calculator sends no packets and changes no device configuration. Actual routing, reservations, implementation limits and measured network conditions must be checked separately. Uses a greedy aligned power-of-two decomposition. This returns multiple blocks where needed rather than one covering supernet with excess addresses.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.