Tililt

Subnet Calculator

Network, broadcast, host range and mask for any IPv4 CIDR block.

How it works

A prefix length says how many leading bits identify the network. /24 fixes the first 24 bits, leaving 8 for hosts — 256 addresses, of which 254 are usable once the network and broadcast addresses are set aside.

Every step down the prefix doubles the block. /23 is two /24s, /22 is four. That doubling is why subnetting arithmetic is done in binary and why the usable figure is 2^(32-prefix) - 2.

Two exceptions: a /31 is a two-address point-to-point link with no broadcast address (RFC 3021), and a /32 is a single host.

Common questions

Why are two addresses unusable?

The all-zeros host address identifies the network itself and the all-ones address is the broadcast. Neither can be assigned to an interface.

What is the wildcard mask for?

It is the subnet mask inverted, and it is what Cisco access lists and OSPF statements expect. A /24 mask of 255.255.255.0 has a wildcard of 0.0.0.255.

Related calculators