Advertisement

CIDR calculator

Convert an IPv4 CIDR block to its full address range or cover any inclusive IPv4 range with the smallest exact set of CIDR blocks.

Calculator

Network or first address
192.168.1.0
Last address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Total addresses
256.000000
Exact CIDR coverage
CIDRFirst addressLast addressAddresses
192.168.1.0/24192.168.1.0192.168.1.255256.000000

Advertisement

How this calculator works

A CIDR prefix selects leading network bits in a 32-bit IPv4 address. CIDR-to-range mode clears host bits and includes all addresses in the block. Range-to-CIDR mode repeatedly chooses the largest aligned power-of-two block that stays within the requested endpoints. Its table covers the range exactly without including outside addresses.

Formula

Addresses in /p = 2^(32-p); network = floor(address / block size) x block size; last = network + block size - 1.

Worked example

192.168.1.10/24 belongs to 192.168.1.0 through 192.168.1.255, 256 addresses. The range 192.168.1.1 through 192.168.1.2 needs two /32 blocks because a /31 must start on an even address.

Advertisement

Frequently asked questions

Does the address count exclude broadcast and network addresses?

No. This page describes the complete range. The IP subnet calculator separately reports conventional usable hosts.

Can an arbitrary range be one CIDR block?

Only if its size is a power of two and its starting address is aligned to that size.

Does this support IPv6?

This tool handles IPv4. The IP address converter has separate IPv6 number conversion.

Sources

Advertisement