Subnet Mask Calculator
How many usable hosts does a /24 subnet have?
A /24 (subnet mask 255.255.255.0) has 256 addresses and 254 usable hosts, since the network and broadcast addresses can't be assigned.
CIDR (RFC 4632) · /31 point-to-point (RFC 3021) · IPv6 (RFC 4291) · runs in your browser ·
Result
Usable hosts
-
IPv4 subnet cheat sheet (/8 to /32)
| CIDR | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /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 |
/31 counts both addresses as usable (RFC 3021); /32 is a single host route.
Something off with the result?
How it's calculated
CIDR (RFC 4632) · /31 point-to-point (RFC 3021) · IPv6 (RFC 4291) · runs in your browser
- CIDR (RFC 4632): /n means the first n bits are the network. Addresses = 2^(32 − n)
- Usable hosts = addresses − 2 (network and broadcast). /31 uses both addresses (RFC 3021); /32 is one address
- Wildcard mask = the subnet mask with every bit flipped. You can also enter a dotted mask (255.255.255.192); masks whose 1 bits are not contiguous are flagged as invalid
- Address type: private (RFC 1918), shared CGNAT space (RFC 6598), loopback, link-local, multicast or public. Classful class (A–E) is shown for reference only
- IPv6 (RFC 4291): first and last address and address count for the prefix, compressed per RFC 5952 (longest run of zero groups becomes ::)
- Everything is calculated in your browser; the address you enter is not sent to a server, analytics or the URL
Frequently asked questions
What does /24 mean in an IP address?
It is CIDR notation (RFC 4632): the first 24 of the 32 bits are the network part. A /24 has the subnet mask 255.255.255.0 and 2^8 = 256 addresses. Leaving out the network address and the broadcast address, 254 are usable for hosts.
How many usable hosts are in a subnet?
Usable hosts = 2^(32 − prefix) − 2, because the first address is the network ID and the last is the broadcast. A /26 gives 62 hosts, a /27 gives 30 and a /30 gives 2. The exceptions are /31, where both addresses are usable on point-to-point links (RFC 3021), and /32, which is a single host.
What is a wildcard mask?
The inverse of the subnet mask: 255.255.255.0 becomes 0.0.0.255. Cisco IOS uses wildcard masks in ACLs and OSPF network statements, while cloud firewalls and security groups usually take CIDR notation such as 10.0.0.0/16.
What are the private IP address ranges?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). They are not routed on the public internet and are used inside home and office networks. 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598).
How big is an IPv6 /64?
A /64 holds 2^64 addresses, about 18.4 quintillion. A /64 is the standard size for a single IPv6 subnet, and sites are commonly assigned a /48 or /56. This calculator shows the first and last address and the address count for any IPv6 prefix.