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.
Subnet mask cheat sheet
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (point-to-point, RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 |
Splitting a network
To divide 192.168.10.0/24 into four equal networks, add two bits to the prefix: you get four /26 networks starting at .0, .64, .128 and .192, each with 62 usable hosts. For networks of different sizes, start with the largest one and assign smaller ones after it, so every subnet starts on a valid boundary.
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.
Is the calculation done online?
Everything is calculated in your browser.
Which private range should I use at home or in an office?
Any RFC 1918 range works. Avoid 192.168.0.0/24 and 192.168.1.0/24 for offices with VPN users, because many home routers use them and the networks would overlap.
How many hosts are in a /26, /27 or /28?
A /26 has 62 usable hosts, a /27 has 30 and a /28 has 14. In general: 2 to the power of (32 − prefix), minus 2.
What is 255.255.255.0 in CIDR?
/24. The mask has 24 bits set to 1.
