IP Subnet Calculator

Network address, broadcast, usable host range and subnet details from an IP and prefix.

Subnetting divides an IP address into a network portion and a host portion. The prefix length says how many leading bits identify the network, which fixes the network address, the broadcast address and exactly how many hosts fit inside.

How CIDR notation works

In 192.168.10.0/24 the /24 means the first 24 bits identify the network, leaving 8 bits for hosts. That gives 2⁸ = 256 addresses, of which 254 are usable.

Two addresses in every ordinary subnet are reserved: the all-zeros host address identifies the network itself, and the all-ones address is the broadcast.

Total addresses = 2^(32 − prefix)
Usable hosts    = 2^(32 − prefix) − 2

Common subnet sizes

CIDRSubnet maskTotalUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

/31 is a special case defined in RFC 3021 for point-to-point links, where both addresses are usable. /32 identifies a single host.

Private address ranges

RFC 1918 reserves three blocks that are never routed on the public internet:

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

Why subnet at all

  • Broadcast containment — broadcast traffic stays inside its subnet, so smaller subnets mean less noise.
  • Security segmentation — traffic between subnets passes a router or firewall where policy can be applied.
  • Address efficiency — a point-to-point link needs two addresses, not 254.
  • Organisation — mapping subnets to departments, sites or VLANs makes networks legible and troubleshooting faster.

Worked example

Using the values pre-loaded in the calculator above:

InputValue
IP address192.168.10.37
Prefix length (CIDR)26
OutputValue
Network192.168.10.0/26
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Network address192.168.10.0
Broadcast address192.168.10.63
First usable host192.168.10.1
Last usable host192.168.10.62
Total addresses64

Frequently asked questions

Why are two addresses unusable in each subnet?

The first identifies the network itself and the last is the broadcast address for that network. Neither can be assigned to a host, except in /31 point-to-point links.

What is the difference between a subnet mask and CIDR?

They express the same thing. 255.255.255.0 and /24 both mean 24 network bits — CIDR is just the compact form.

How do I pick a prefix length?

Count the hosts you need, add headroom, then choose the smallest subnet that fits. Twenty hosts needs a /27 (30 usable); sixty needs a /26 (62 usable).

What is a wildcard mask?

The bitwise inverse of the subnet mask, used in Cisco access control lists and OSPF. The inverse of 255.255.255.0 is 0.0.0.255.