Subnet Calculator

What is a subnet?

A subnet is a block of IP addresses that belong together on one network – for example, every device in an office or on one VLAN. Splitting a large network into subnets keeps broadcast traffic down, makes firewall rules simpler and lets you separate things like staff, guests, servers and phones.

What does /24 mean?

The number after the slash – the prefix length or CIDR notation – says how many of the 32 bits in an IPv4 address identify the network. The rest identify individual devices. In 192.168.1.0/24 the first 24 bits (192.168.1) are the network, leaving 8 bits – 256 addresses – for hosts. The same thing written as a subnet mask is 255.255.255.0.

Why are there two fewer usable hosts?

In a normal subnet the first address is the network address (it names the subnet itself) and the last is the broadcast address (used to reach every device at once). Neither can be given to a device, so a /24 has 256 addresses but 254 usable ones. Two special cases: a /31 is used for point-to-point links and both its addresses are usable, and a /32 is a single host.

What is a wildcard mask?

A wildcard mask is the subnet mask flipped – 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF configuration use wildcard masks instead of subnet masks.

Subnet cheat sheet

CIDRSubnet maskWildcardAddressesUsable hosts
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574
/16 255.255.0.0 0.0.255.255 65,536 65,534
/20 255.255.240.0 0.0.15.255 4,096 4,094
/21 255.255.248.0 0.0.7.255 2,048 2,046
/22 255.255.252.0 0.0.3.255 1,024 1,022
/23 255.255.254.0 0.0.1.255 512 510
/24 255.255.255.0 0.0.0.255 256 254
/25 255.255.255.128 0.0.0.127 128 126
/26 255.255.255.192 0.0.0.63 64 62
/27 255.255.255.224 0.0.0.31 32 30
/28 255.255.255.240 0.0.0.15 16 14
/29 255.255.255.248 0.0.0.7 8 6
/30 255.255.255.252 0.0.0.3 4 2
/31 255.255.255.254 0.0.0.1 2 2
/32 255.255.255.255 0.0.0.0 1 1

Private IP address ranges

These ranges are reserved for internal networks and are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Internet providers using carrier-grade NAT also use 100.64.0.0/10.

More free tools