CIDR notation such as /24 tells you how many bits identify the network; the rest identify hosts.
How to use the IP Subnet Calculator
- Prefix length (/n)
Results update as you type, and every field accepts the units shown in its menu.
How it works
The host bits determine the number of addresses; the network and broadcast addresses are not usable for hosts.
Formula
Addresses = 2^(32 − prefix)Usable hosts = addresses − 2Worked example
Inputs — Prefix length (/n): 24.
Results — Total addresses = 256; Usable hosts = 254; Mask octet 1 = 255; Mask octet 2 = 255; Mask octet 3 = 255; Mask octet 4 = 0.
Frequently asked questions
What mask is /24?
255.255.255.0, with 254 usable hosts.
Why subtract two?
The first address names the network and the last is the broadcast address.
What formula does the IP Subnet Calculator use?
Addresses = 2^(32 − prefix).