How to use the IPv4 Subnet Calculator tool
- Enter an IPv4 address with a prefix (/24) or a subnet mask (255.255.255.0).
- Or pick the prefix from the list to see how the network changes.
- Copy any value you need.
How subnetting works
An IPv4 address has 32 bits. The prefix length, written after a slash, says how many of those bits identify the network; the rest identify hosts. In 192.168.1.10/24, the first 24 bits (192.168.1) are the network and the last 8 bits leave room for 256 addresses.
Two addresses in every normal subnet are reserved: the first is the network address and the last is the broadcast address. That is why a /24 has 254 usable hosts, not 256. Point-to-point links often use /31 (RFC 3021), where both addresses are usable, and /32 describes a single host.
Quick reference
- /30: mask 255.255.255.252, 2 usable hosts (classic router link)
- /29: 255.255.255.248, 6 hosts
- /28: 255.255.255.240, 14 hosts
- /27: 255.255.255.224, 30 hosts
- /26: 255.255.255.192, 62 hosts
- /24: 255.255.255.0, 254 hosts
- /22: 255.255.252.0, 1,022 hosts
- /16: 255.255.0.0, 65,534 hosts
The wildcard mask is the inverse of the subnet mask and is used in Cisco ACLs and OSPF configuration. The calculator also tells you whether an address is private (RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), carrier-grade NAT, loopback or link-local.
Privacy
All calculations run in your browser. Nothing you enter is sent anywhere.
Frequently asked questions
How many hosts are in a /24?
256 addresses, of which 254 can be assigned to hosts.
What is the difference between CIDR and a subnet mask?
They describe the same thing. /24 and 255.255.255.0 both mean the first 24 bits are the network part.
Are address classes still used?
No. Classful addressing (A, B, C) was replaced by CIDR in 1993. The class is shown only for reference, because some exams and old equipment still mention it.
Can I use the network or broadcast address for a device?
Not in a normal subnet. The exception is /31 point-to-point links and /32 single-host routes.