Subnet and CIDR calculator

Calculate a subnet, cover an IP range exactly or check one address against a CIDR. These tools use address arithmetic without IP lookups.

Reset

192.0.2.0/31

Normalized IPv4 network

31 network bits1 host bits
IPv4 has 32 bits. The prefix fixes 31; 1 remain for addresses in the block.
First address
192.0.2.0
Last address
192.0.2.1
Total addresses
2
Prefix length
/31

IPv4 host range

Subnet mask
255.255.255.254
Wildcard mask
0.0.0.1
Usable addresses
2
First usable
192.0.2.0
Last usable
192.0.2.1

For /31 point-to-point links, both addresses are counted as host addresses.

No published network profile is available for this exact CIDR. The boundary calculation is still valid.

IP range to CIDR

Cover an inclusive address range with the smallest exact set of CIDRs. No addresses outside the range are included.

IP range to CIDR

Check IP membership

Check whether one address is inside a CIDR. This checks address boundaries, not network activity.

Check IP membership

Reading the calculation

An IPv4 /24 keeps 24 bits fixed and leaves 8 bits for addresses within the block: 2^8 = 256 addresses. A /25 leaves 7 bits, so it contains 128. Increasing the prefix length makes the block smaller.

IPv4 /31 point-to-point links use both addresses; a /32 identifies one address. IPv6 has no broadcast address. Documentation blocks such as 192.0.2.0/24 and 2001:db8::/32 do not imply public routability.

The six-address example below needs four CIDR blocks. A single /29 would cover eight addresses, including the address just before the requested range and the one just after it. Those extra addresses matter when the result becomes a firewall rule.

192.0.2.1 – 192.0.2.6

192.0.2.1/32
192.0.2.2/31
192.0.2.4/31
192.0.2.6/32

Membership includes both boundary addresses. The network and IPv4 broadcast addresses are inside the CIDR too. The host-range fields show which addresses the calculator counts as IPv4 hosts.

Full-list access.

For pricing or full-list access, email contact@ipquery.io.

Selected list
Selected records
Records in this list