A /31 subnet mask is 255.255.255.254, with 2 addresses and 2 usable hosts.
| CIDR prefix | /31 |
|---|---|
| Subnet mask | 255.255.255.254 |
| Subnet mask (binary) | 11111111.11111111.11111111.11111110 |
| Wildcard mask | 0.0.0.1 |
| Network bits / host bits | 31 / 1 |
| Total addresses | 2 |
| Usable hosts | 2 |
| /31 subnets in a /8 | 8,388,608 |
| /31 subnets in a /16 | 32,768 |
| /31 subnets in a /24 | 128 |
The mask ends 7 bits into octet 4, so blocks step in increments of 2 in that octet. Two addresses and no network or broadcast address (RFC 3021), used for point-to-point links where every address counts.
| Network | First usable host | Last usable host | Broadcast |
|---|---|---|---|
| 192.168.1.0/31 | 192.168.1.0 | 192.168.1.1 | 192.168.1.1 |
| 192.168.1.2/31 | 192.168.1.2 | 192.168.1.3 | 192.168.1.3 |
| 192.168.1.4/31 | 192.168.1.4 | 192.168.1.5 | 192.168.1.5 |
| 192.168.1.6/31 | 192.168.1.6 | 192.168.1.7 | 192.168.1.7 |
| 192.168.1.8/31 | 192.168.1.8 | 192.168.1.9 | 192.168.1.9 |
| 192.168.1.10/31 | 192.168.1.10 | 192.168.1.11 | 192.168.1.11 |
| 192.168.1.12/31 | 192.168.1.12 | 192.168.1.13 | 192.168.1.13 |
| 192.168.1.14/31 | 192.168.1.14 | 192.168.1.15 | 192.168.1.15 |
A /31 subnet mask is 255.255.255.254. In binary that is 11111111.11111111.11111111.11111110: 31 network bits followed by 1 host bits. The wildcard mask is 0.0.0.1.
A /31 holds 2 addresses. With RFC 3021 both are usable on a point-to-point link, because no network or broadcast address is reserved.
A /24 divides into 128 subnets of size /31, because each extra mask bit doubles the number of subnets.
Calculate this over HTTP: curl https://networkcalc.com/api/ip/192.168.1.0/31.
See the Subnet Calculator API.