Home Net Guide

Home / Subnet calculator / /31

/31 subnet: mask 255.255.255.254

A /31 network holds 2 addresses, both usable on a point-to-point link. Its subnet mask is 255.255.255.254.

Prefix length (CIDR)
/31
Subnet mask
255.255.255.254
Wildcard mask
0.0.0.1
Mask in binary
11111111.11111111.11111111.11111110
Network bits / host bits
31 / 1
Total addresses
2 (2 to the power of 1)
Usable host addresses
2 (point-to-point links only)
Fits
128 times into a /24

What a /31 is used for

A /31 has exactly two addresses and, by a special rule (RFC 3021), both are usable: on a link with only two ends there is no need for a network or broadcast address. Network operators use /31s on router-to-router links to waste half as many addresses as a /30. Some consumer equipment does not accept them.

Worked example: which /31 is 192.168.1.130 in?

The mask's value in the fourth octet is 254, so networks advance in steps of 256 minus 254, which is 2, in that octet: 0, 2, 4, 6 and so on up to 254. The fourth octet of 192.168.1.130 is 130, which falls in the step that starts at 130. The network is therefore 192.168.1.130/31.

Network
192.168.1.130/31
Addresses
192.168.1.130 to 192.168.1.131
Broadcast address
None: a /31 has no broadcast address
Next /31 begins at
192.168.1.132/31

Open this example in the subnet calculator to see it bit by bit, or to try your own address.

The first 16 of the 128 /31 networks in 192.168.1.0/24

NetworkAddressesBroadcast
192.168.1.0/31192.168.1.0 to 192.168.1.1None
192.168.1.2/31192.168.1.2 to 192.168.1.3None
192.168.1.4/31192.168.1.4 to 192.168.1.5None
192.168.1.6/31192.168.1.6 to 192.168.1.7None
192.168.1.8/31192.168.1.8 to 192.168.1.9None
192.168.1.10/31192.168.1.10 to 192.168.1.11None
192.168.1.12/31192.168.1.12 to 192.168.1.13None
192.168.1.14/31192.168.1.14 to 192.168.1.15None
192.168.1.16/31192.168.1.16 to 192.168.1.17None
192.168.1.18/31192.168.1.18 to 192.168.1.19None
192.168.1.20/31192.168.1.20 to 192.168.1.21None
192.168.1.22/31192.168.1.22 to 192.168.1.23None
192.168.1.24/31192.168.1.24 to 192.168.1.25None
192.168.1.26/31192.168.1.26 to 192.168.1.27None
192.168.1.28/31192.168.1.28 to 192.168.1.29None
192.168.1.30/31192.168.1.30 to 192.168.1.31None

One size up and one size down

Each bit removed from the prefix doubles a network, and each bit added halves it. A /30 is twice the size, with 2 usable addresses, and a /32 is half the size, with 1 usable address. The table of every prefix size compares them all.