← CIDR calculator

The /31 subnet, explained

Everything about a /31 CIDR block — mask, address count, usable hosts and where a /31 fits in real network plans.

2
Total addresses
2
Usable hosts
255.255.255.254
Subnet mask
0.0.0.1
Wildcard mask
Prefix length/31 — 31 network bits, 1 host bits
Subnet mask255.255.255.254
Wildcard (ACL) mask0.0.0.1
Binary mask11111111.11111111.11111111.11111110
Total addresses2^1 = 2
Usable hosts2 (RFC 3021 point-to-point — both addresses usable)
A /16 holds32,768 × /31 subnets
Example block192.168.1.0/31

Notes

A /31 prefix means the first 31 bits of the 32-bit IPv4 address identify the network and the remaining 1 bits identify hosts — giving 2^1 = 2 addresses. RFC 3021 makes both addresses of a /31 usable on point-to-point links.

Cloud sizing: too small for an AWS VPC (minimum /28 per VPC, /29 allowed for GCP subnets; /31 and /32 are for point-to-point links and host routes, not subnets).

Adjacent sizes: /8 · /9 · /10 · /11 · /12 · /13 · /14 · /15 · /16 · /17 · /18 · /19 · /20 · /21 · /22 · /23 · /24 · /25 · /26 · /27 · /28 · /29 · /30 · /32

Frequently asked questions

How many IP addresses are in a /31?

2 total addresses, of which 2 are usable hosts.

What is the subnet mask for /31?

255.255.255.254 (wildcard mask 0.0.0.1).

What does /31 mean in an IP address?

The /31 suffix is CIDR notation: the first 31 bits are the network part, the last 1 bits are the host part.

Found this useful? 113 free, browser-only tools by Yuvrajsinh Jadav — an engineer who ships production AI systems. No account, nothing sent anywhere.