/31 · 255.255.255.254
Open in the calculator
2 addresses and, thanks to RFC 3021, both are usable: there is no network or broadcast address on a /31 point-to-point link. Supported by all modern routers and by Linux; some older devices still expect a /30.
Key numbers
| Prefix length | /31 (31 network bits, 1 host bits) |
| Subnet mask | 255.255.255.254 |
| Mask in binary | 11111111.11111111.11111111.11111110 |
| Wildcard mask | 0.0.0.1 |
| Total addresses | 2 |
| Usable hosts | 2 (RFC 3021 point-to-point) |
| Fits in a /24 | 128 times |
| Block size | Increments of 2 in octet 4 |
Example ranges
Private (RFC 1918) blocks of this size. Click one to open it in the calculator.
| Block | First address | Last address | Usable hosts |
|---|---|---|---|
| 10.0.0.0/31 | 10.0.0.0 | 10.0.0.1 | 10.0.0.0 – 10.0.0.1 |
| 172.16.0.0/31 | 172.16.0.0 | 172.16.0.1 | 172.16.0.0 – 172.16.0.1 |
| 192.168.0.0/31 | 192.168.0.0 | 192.168.0.1 | 192.168.0.0 – 192.168.0.1 |
Usable addresses in the cloud
Cloud providers reserve a few addresses in every subnet for the router, DNS and future use, so the usable count is lower than the formula gives.
| Provider | Usable in a /31 | Notes |
|---|---|---|
| AWS VPC subnet | n/a | Not allowed: AWS subnets must be between /16 and /28. |
| Azure virtual network subnet | n/a | Not allowed: /29 is the smallest Azure subnet. |
| Google Cloud subnet | n/a | Not allowed: /29 is the smallest primary range. |
How the numbers are derived
An IPv4 address has 32 bits. A /31 uses 31 of them for the network, leaving 1 host bits, so the block has 21 = 2 addresses. The subnet mask is 31 ones followed by 1 zeros, written in dotted decimal as 255.255.255.254; the wildcard mask 0.0.0.1 is its inverse, used in Cisco ACLs and OSPF configuration.
FAQ
How many hosts can a /31 have?
Two, and both are usable on a point-to-point link under RFC 3021.
How many /31 subnets fit in a /24?
128. A /24 has 256 addresses and a /31 has 2, so 256 ÷ 2 = 128 blocks.