How to use the subnet calculator
Type an address followed by a slash and a prefix length, such as 192.168.1.10/24. A dotted mask works too: 192.168.1.10 255.255.255.0. The calculator finds the subnet that contains the address and shows where it starts and ends.
To divide a network, put the new prefix in the second box. Entering 10.0.0.0/22 and /24 lists the four /24 networks inside it. Up to 256 subnets are listed.
The calculation runs in your browser. The addresses you type are not sent to us or to anyone else.
What the results mean
- Network address: the first address in the subnet. It names the subnet and is not given to a device.
- Broadcast address: the last address in an IPv4 subnet. A packet sent to it reaches every device on that subnet. IPv6 has no broadcast and uses multicast instead.
- Usable host range: the addresses you can assign. In IPv4 that is everything between the network and broadcast addresses.
- Subnet mask: marks which bits of an address identify the network.
255.255.255.0and/24say the same thing: the first 24 bits. - Wildcard mask: the subnet mask inverted. Access control lists on Cisco equipment and OSPF configuration use it.
Common IPv4 subnet sizes
| Prefix | Subnet mask | Total 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 (point-to-point links) |
| /32 | 255.255.255.255 | 1 | 1 (a single host) |
Questions
Why are two addresses lost in every IPv4 subnet?
The first address identifies the network and the last is the broadcast address, so neither can be assigned to a device. A /24 has 256 addresses and 254 usable ones. Two sizes are exceptions: a /31 uses both addresses for a point-to-point link (RFC 3021), and a /32 is one host.
How many hosts fit in a subnet?
Take 2 to the power of the host bits, then subtract 2 for IPv4. A /26 leaves 6 host bits: 26 is 64 addresses and 62 hosts.
Does this work for IPv6?
Yes. Enter something like 2001:db8:abcd::/48. IPv6 subnets have no broadcast address and every address in the range is usable. A /64 is the normal size for a single network segment.
What prefix should a home network use?
Most home routers use a /24 such as 192.168.1.0/24, which gives 254 addresses. That is enough for nearly every household.