How subnetting works
A prefix length (/24, /26 …) says how many leading bits identify the network; the remaining bits number the hosts. A /24 leaves 8 host bits: 256 addresses, of which 254 are usable because the first is the network address and the last is the broadcast address.
All calculations run in your browser. /31 networks follow RFC 3021 (two usable addresses for point-to-point links) and /32 describes a single host.
Common subnet masks
| Prefix | Subnet mask | Usable hosts |
|---|---|---|
| /30 | 255.255.255.252 | 2 |
| /29 | 255.255.255.248 | 6 |
| /28 | 255.255.255.240 | 14 |
| /27 | 255.255.255.224 | 30 |
| /26 | 255.255.255.192 | 62 |
| /25 | 255.255.255.128 | 126 |
| /24 | 255.255.255.0 | 254 |
| /23 | 255.255.254.0 | 510 |
| /22 | 255.255.252.0 | 1,022 |
| /16 | 255.255.0.0 | 65,534 |
| /8 | 255.0.0.0 | 16,777,214 |
Subnets on a home network
Most home routers use a /24 such as 192.168.1.0/24 — up to 254 devices. If you add a second router, give it a different subnet (for example 192.168.2.0/24) to avoid address conflicts. See public vs private IP addresses.
Questions
What is a wildcard mask?
The inverse of the subnet mask (0.0.0.255 for a /24). Cisco access lists and some routing protocols use it to match address ranges.
How many subnets do I get if I split a /24 into /26?
Four subnets of 64 addresses each (62 usable hosts per subnet).