How it works
The prefix (/24) says how many leading bits are the network part. The rest are host bits: a /24 has 8 host bits, so 256 addresses. The first is the network address and the last is the broadcast address, leaving 254 for hosts.
Special cases
- /31: 2 addresses, both usable on point-to-point links (RFC 3021), no broadcast.
- /32: a single host.
- Private ranges (RFC 1918):
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16. Carrier-grade NAT uses100.64.0.0/10(RFC 6598).
Quick table
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /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 |
| /23 | 255.255.254.0 | 512 | 510 |
| /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 |
Related: what is my IP · IP owner lookup
Sources
- RFC 1918: Address allocation for private internets: www.rfc-editor.org/rfc/rfc1918
- RFC 3021: Using 31-bit prefixes on point-to-point links: www.rfc-editor.org/rfc/rfc3021
- RFC 6598: Shared address space (100.64.0.0/10): www.rfc-editor.org/rfc/rfc6598