IPv4 subnet and CIDR calculator
Calculate an IPv4 network, subnet mask, address range and conventional usable count from an address and CIDR prefix, including /31 and /32.
Network in CIDR notation
Change an input to update the result.
Inputs are processed in this tab. No text, paths or results are sent to our server or saved in an account. Privacy details.
From input to a useful answer.
- 01
Enter four decimal IPv4 octets and a CIDR prefix.
- 02
Inspect the network, mask, address range and counts.
- 03
Apply the /31 or /32 note before planning assignments.
A prefix describes an address block
An IPv4 address has 32 bits. A CIDR prefix states how many belong to the network portion, leaving 32 minus the prefix length for addresses inside the block. The total is 2 raised to that remaining-bit count. Prefixes from /0 through /32 are accepted.
Use four decimal octets from 0 to 255 without leading zeroes. The tool finds the containing network even when the entered address is a host inside it. It also shows subnet and wildcard masks, which describe the same boundary in complementary forms.
Work through a /26 example
For 192.0.2.130/26, six address bits remain, giving 64 total addresses. The containing network is 192.0.2.128 and the final address is 192.0.2.191. The mask is 255.255.255.192 and wildcard 0.0.0.63. These follow the prefix rather than an assumed old address class.
For prefixes shorter than /31, the conventional usable count subtracts network and directed-broadcast addresses. This example shows 62, from .129 through .190. It does not reserve another address for a router or inspect your DHCP configuration.
Treat /31 and /32 separately
A /31 contains two addresses. Under RFC 3021, both can identify endpoints on an appropriate point-to-point link, so the calculator shows two usable addresses and no directed-broadcast address. This should not be read as a general recommendation for a shared home LAN.
A /32 identifies one address, shown as one total and one usable. Counts are mathematical, not confirmation that an address can be assigned. Reserved ranges, device support, routing and existing assignments need separate checks. The tool sends no packets and changes no network settings.
References
RFC 4632 — CIDR and prefix notation ↗RFC 3021 — IPv4 point-to-point /31 links ↗A few useful answers
Why does /31 show two usable addresses?
It follows RFC 3021’s point-to-point interpretation. Both ends and the link design must support that use.
Does the usable count include a router address?
It does not deduct a separate gateway reservation. Conventional subnets subtract only network and broadcast addresses.
Can it tell whether an address is in use?
No. It calculates the block locally without probing devices, inspecting DHCP leases or evaluating reserved-range policy.