/31 Subnet Mask

A /31 subnet mask is 255.255.255.254, with 2 addresses and 2 usable hosts.

CIDR prefix/31
Subnet mask255.255.255.254
Subnet mask (binary)11111111.11111111.11111111.11111110
Wildcard mask0.0.0.1
Network bits / host bits31 / 1
Total addresses2
Usable hosts2
/31 subnets in a /88,388,608
/31 subnets in a /1632,768
/31 subnets in a /24128

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.

Try it with an address

Example /31 subnets in 192.168.1.0/24

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

Frequently asked questions

What is the subnet mask for /31?

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.

How many usable hosts are in a /31?

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.

How many /31 subnets fit in a /24?

A /24 divides into 128 subnets of size /31, because each extra mask bit doubles the number of subnets.

Other prefix lengths

← /30 Full CIDR chart /32 →

Calculate this over HTTP: curl https://networkcalc.com/api/ip/192.168.1.0/31. See the Subnet Calculator API.