Subnet Mask Calculator
Enter an IPv4 address and a CIDR prefix length.
How this calculator works
The CIDR prefix tells you how many of the 32 address bits belong to the network. The subnet mask has that many leading 1s. The network address is the IP ANDed with the mask, the broadcast address sets all host bits to 1, and usable hosts are 2 to the power of the host bits, minus 2.
Frequently asked questions
What does /24 mean?
The first 24 bits are the network, giving mask 255.255.255.0 and 254 usable hosts.
What is a wildcard mask?
The inverse of the subnet mask, often used in access control lists.
Why subtract 2 from the host count?
One address is the network address and one is the broadcast address, so neither can be given to a device.