The /31 subnet

A /31 subnet uses the mask 255.255.255.254 and holds 2 addresses, 2 of them usable.

/31
Prefix length
255.255.255.254
Subnet mask
0.0.0.1
Wildcard mask
2
Usable hosts

A /31 covers two IPv4 addresses and, under RFC 3021, both are usable. The mask is 255.255.255.254, so it is the standard choice for point-to-point links where a full /30 would waste two addresses on network and broadcast.

On a /31 there is no separate broadcast address; the two hosts simply talk to each other. Router vendors have supported /31 links for years, and they halve the address cost of every point-to-point circuit.

Below you can see the exact network, broadcast, and host range for any /31 you enter, calculated instantly in your browser.

Calculate a /31 network

Accepts CIDR (192.0.2.0/24), IP + mask (192.0.2.0 255.255.255.0), or a bare IP (defaults to /24).

Network address192.0.2.0
Usable host range192.0.2.0 - 192.0.2.1
Broadcast address192.0.2.1
Usable hosts2
Subnet mask255.255.255.254
Wildcard mask0.0.0.1
CIDR notation192.0.2.0/31
Total addresses2
IP (binary)11000000.00000000.00000010.00000000
Mask (binary)11111111.11111111.11111111.11111110
Try:

Example: 192.0.2.0/31

Taking 192.0.2.0/31 as a worked example, the block breaks down like this:

Network address192.0.2.0
Usable range192.0.2.0 - 192.0.2.1
Broadcast address192.0.2.1
Total addresses2
Usable hosts2
Size1/128 of a class C block

Frequently asked questions

What is the subnet mask for a /31?

A /31 uses the subnet mask 255.255.255.254. Its wildcard mask, used in access lists, is 0.0.0.1.

How many hosts are in a /31 subnet?

A /31 has 2 total addresses and 2 usable hosts (the total minus the network and broadcast addresses, except for /31 and /32).

What is a /31 used for?

Point-to-point link (RFC 3021). It is equivalent to 1/128 of a class C block.

How do I calculate a /31 network?

Set the host bits to zero for the network address and to one for the broadcast address. The calculator on this page does it for any /31 block you enter.