SaveMyCert
IPv4 tool

Subnet calculator

Enter an IPv4 address with a prefix or subnet mask to get its network and broadcast addresses, usable host range, wildcard mask and host count. Unlike most subnet calculators, it also shows the working, so you can check the method you will need in an exam.

For example 10.20.30.40/20 or 10.20.30.40 255.255.240.0.

192.168.10.77/27
Network address192.168.10.64/27
Broadcast address192.168.10.95
Usable host range192.168.10.65 – 192.168.10.94
Subnet mask255.255.255.224
Wildcard mask0.0.0.31
Total addresses32
Usable hosts30
Usable in an AWS VPC subnet27
Address typePrivate (RFC 1918, 192.168.0.0/16)

How it is worked out

  1. /27 means a mask of 255.255.255.224.
  2. The interesting octet is the fourth one, where the mask is 224. Block size = 256 − 224 = 32.
  3. Subnets in that octet start at multiples of 32. 77 falls in the block from 64 to 95.
  4. Network address = 192.168.10.64; broadcast = the next block minus one = 192.168.10.95.
  5. Usable hosts run from the network plus one to the broadcast minus one: 192.168.10.65 to 192.168.10.94, which is 2^5 − 2 = 30 addresses.

Worked examples

One example for each place a mask can stop, plus a point-to-point /31. The block size is 256 minus the mask value in the octet where the mask stops being 255.

Subnet calculations for common prefixes
AddressMaskNetworkBroadcastUsable rangeHosts
10.4.200.19/12255.240.0.010.0.0.010.15.255.25510.0.0.1 – 10.15.255.2541,048,574
172.16.45.9/20255.255.240.0172.16.32.0172.16.47.255172.16.32.1 – 172.16.47.2544,094
192.168.10.77/27255.255.255.224192.168.10.64192.168.10.95192.168.10.65 – 192.168.10.9430
10.0.0.6/30255.255.255.25210.0.0.410.0.0.710.0.0.5 – 10.0.0.62
10.255.0.1/31255.255.255.25410.255.0.0—10.255.0.0 – 10.255.0.12

Wildcard masks

The wildcard mask is the subnet mask inverted: subtract each octet from 255. Cisco IOS reads it bit by bit, where 0 means the address bit must match and 1 means ignore it.

Subnet masks and their wildcard masks
PrefixSubnet maskWildcard mask
/8255.0.0.00.255.255.255
/16255.255.0.00.0.255.255
/20255.255.240.00.0.15.255
/22255.255.252.00.0.3.255
/24255.255.255.00.0.0.255
/26255.255.255.1920.0.0.63
/27255.255.255.2240.0.0.31
/28255.255.255.2400.0.0.15
/29255.255.255.2480.0.0.7
/30255.255.255.2520.0.0.3

Practise the method

Subnet calculator: your questions

Use the block-size method. Find the octet where the mask is neither 255 nor 0, subtract that mask value from 256 to get the block size, and find the largest multiple of the block size that does not exceed the address in that octet. That multiple is the network address; the broadcast is the next block minus one.