Enter an IP and a mask (CIDR or dotted-decimal) to get the network address, broadcast address, usable host range and host count.
In CIDR notation, 192.168.1.0/24 means the first 24 bits identify the network and the remaining 8 bits identify the host. That leaves 2⁸ = 256 addresses in the block, of which two are reserved, giving 254 usable host addresses.
| CIDR | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 — typical for point-to-point links |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /24 | 255.255.255.0 | 256 | 254 — the familiar home or office LAN |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /8 | 255.0.0.0 | 16.7 million | 16.7 million − 2 |
Two exceptions to remember: a /31 has no reserved addresses and gives two usable host addresses, which is why it is used for point-to-point links; and a /32 identifies a single host.
Each reduction of the prefix by one doubles the block size. A /25 is two /26s, four /27s and so on. Because the mask has to be contiguous, valid subnet masks are only ever a run of ones followed by a run of zeros — 255.255.255.192 is valid, 255.255.255.100 is not.
Most of the arithmetic you need is a lookup. Each step up the list halves the block:
| CIDR | Mask | Addresses | Usable hosts |
|---|---|---|---|
/32 | 255.255.255.255 | 1 | 1 — a single host route |
/31 | 255.255.255.254 | 2 | 2 — point-to-point, no reserved addresses |
/30 | 255.255.255.252 | 4 | 2 |
/29 | 255.255.255.248 | 8 | 6 |
/28 | 255.255.255.240 | 16 | 14 |
/27 | 255.255.255.224 | 32 | 30 |
/26 | 255.255.255.192 | 64 | 62 |
/25 | 255.255.255.128 | 128 | 126 |
/24 | 255.255.255.0 | 256 | 254 |
/23 | 255.255.254.0 | 512 | 510 |
/22 | 255.255.252.0 | 1,024 | 1,022 |
/20 | 255.255.240.0 | 4,096 | 4,094 |
/16 | 255.255.0.0 | 65,536 | 65,534 |
/12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
/8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
Two anchors are enough to rebuild the rest: a /24 holds 254 usable hosts, and moving one step in either direction doubles or halves both columns — except /31 and /32, which have no network or broadcast address to reserve.