IPv4 subnet calculator
Enter an address with a CIDR prefix (10.0.0.0/22) or with a mask (10.0.0.0 255.255.252.0). It runs in your browser; nothing is sent anywhere.
Calculator
The prefix menu is used only when the field has no / or mask.
- CIDR notation
- 192.168.1.0/24
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Network address
- 192.168.1.0
- Broadcast address
- 192.168.1.255
- First usable host
- 192.168.1.1
- Last usable host
- 192.168.1.254
- Total addresses
- 256
- Usable hosts
- 254
- Address type
- Private (RFC 1918)
- Mask in binary
- 11111111.11111111.11111111.00000000
- Address in binary
- 11000000.10101000.00000001.00001010
Common prefix lengths
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /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 |
| /32 | 255.255.255.255 | 1 | 1 |
Questions
How many usable hosts does a subnet have?
Two to the power of the host bits, minus two: the network address and the broadcast address cannot be assigned to hosts. A /24 has 2^8 − 2 = 254 usable hosts, a /26 has 62 and a /30 has 2.
What is a /31 or a /32?
A /31 has two addresses and, under RFC 3021, both are usable: it is meant for point-to-point links between two routers. A /32 is a single address, used for a host route or a loopback.
What is a wildcard mask?
The inverse of the subnet mask: ones where the address may vary. 255.255.255.0 becomes 0.0.0.255. Access lists and some routing configurations use it instead of the mask.
Which addresses are private?
The RFC 1918 ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routed on the public internet. 100.64.0.0/10 is shared space used by carrier-grade NAT, and 169.254.0.0/16 is link-local.
How do I choose a subnet size?
Count the hosts you need today, add room to grow, and round up to the next power of two plus two. Do not make subnets much larger than needed: a large broadcast domain carries more noise and is harder to secure.