/31 Subnet Mask: 255.255.255.254

A /31 prefix fixes the first 31 bits of the address as the network, leaving 1 bits for hosts. That gives 2 addresses, of which 2 can be assigned to hosts.

CIDR notation/31
Subnet mask255.255.255.254
Wildcard mask0.0.0.1
Binary mask11111111.11111111.11111111.11111110
Hex mask0xFFFFFFFE
Total addresses2
Usable hosts2

Example: 192.168.1.0/31

  • Network address: 192.168.1.0
  • First usable host: 192.168.1.0
  • Last usable host: 192.168.1.1

When to use a /31 subnet

Two addresses with no network or broadcast address (RFC 3021), used for point-to-point links between routers.

  • 8,388,608 /31 subnets fit in a /8.
  • 32,768 /31 subnets fit in a /16.
  • 128 /31 subnets fit in a /24.

Frequently Asked Questions

What is the subnet mask for /31?

The subnet mask for /31 is 255.255.255.254, and its wildcard (inverse) mask is 0.0.0.1.

How many hosts are in a /31?

A /31 contains 2 addresses, and all of them are usable because RFC 3021 point-to-point links do not reserve network or broadcast addresses.