Subnet calculator (CIDR)

Calculate an IPv4 network from an address and prefix. See its mask, address range, and mathematical host count.

Input is processed in your browser and is not sent to the server.

Quick start

  1. Enter an IPv4 address and prefix.
  2. Review the range and address count.
  3. Exclude reserved addresses before allocation.

Example: 192.168.1.25/24

FieldValueMeaning
Network192.168.1.0/24The containing block
Mask255.255.255.024 network bits
Total256 addresses2^(32−24)
Typical host range192.168.1.1–192.168.1.254Excludes network and broadcast
Broadcast192.168.1.255Last address in a conventional subnet

Actual allocation

For conventional /0–/30 calculations, the first and last addresses are excluded. /31 allows two addresses on supported point-to-point links; /32 identifies a single address.

This is a mathematical calculation. It cannot identify addresses reserved by a cloud provider, router, or an existing allocation. /31 is not a promise that both addresses work on every LAN.

Private does not mean every other address is public

RFC1918 defines 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Loopback, documentation, multicast, and other special ranges also exist.

Classification applies to the input IP, not every address in a large CIDR block. Unclassified addresses are not automatically reachable from the internet.

Splitting a /24 into four /26 subnets

To split one /24 by purpose, lengthen the prefix by 2 to get four subnets of the same size. Each /26 has 64 addresses and 62 usable hosts in the usual case.

SubnetHost rangeBroadcast
192.168.10.0/26192.168.10.1 ~ 192.168.10.62192.168.10.63
192.168.10.64/26192.168.10.65 ~ 192.168.10.126192.168.10.127
192.168.10.128/26192.168.10.129 ~ 192.168.10.190192.168.10.191
192.168.10.192/26192.168.10.193 ~ 192.168.10.254192.168.10.255

Enter the network address of any row into this calculator to see the same range.

Addresses you can actually use in a cloud subnet

Cloud providers reserve some addresses in every subnet for the gateway, DNS and similar functions. The same /24 therefore offers a different number of assignable addresses on each provider.

ProviderReserved addressesAssignable in a /24
AWSFirst 4 and last 1 (5)251
Microsoft AzureFirst 4 and last 1 (5)251
Google CloudFirst 2 and last 2 (4)252
Oracle Cloud (OCI)First 2 and last 1 (3)253

The smaller the subnet, the bigger the difference. The smallest AWS subnet, a /28, offers only 11 of its 16 addresses.

Frequently asked questions

Does this calculate IPv6 networks?
This calculator currently supports IPv4 only.

Official references

Related tools

Further reading