/31 subnet.
A /31 is a small IPv4 block containing 2 total addresses. It uses 31 network bits and 1 host bit, with subnet mask 255.255.255.254.
What does /31 mean?
IPv4 addresses contain 32 bits. A /31 CIDR prefix means the first 31 bits identify the network and the remaining 1 bit identifies addresses within that network. Because there are 1 host bits, the block contains 21, or 2, total IPv4 addresses. In practical terms, /31 is a 2-address prefix with special point-to-point semantics under RFC 3021.
/31 subnet mask
The dotted-decimal subnet mask for /31 is 255.255.255.254. Its inverse wildcard mask is 0.0.0.1. These are different notations for the same network/host boundary: the subnet mask marks network bits with ones, while the wildcard mask flips those bits.
How many hosts are in a /31?
A /31 contains two addresses. RFC 3021 permits both addresses to be used on point-to-point links, where traditional network/broadcast semantics are unnecessary.
How /31 boundaries behave
Within a /24-style final-octet view, /31 blocks advance in increments of 2 addresses when the prefix is at least /24. This makes network boundaries predictable and easy to verify. Increasing the prefix to /32 halves the addresses in each child block. Decreasing it to /30 combines this address space with an adjacent block of the same size.
When would you use a /31?
The right prefix depends on route aggregation, host requirements, topology and operational policy rather than on a single universal rule. Large prefixes with smaller numbers represent broad address aggregates; prefixes closer to /32 represent progressively smaller blocks. For ordinary IPv4 LAN planning, always verify that the chosen prefix has enough conventional usable host addresses and leaves appropriate room for growth.
Compare nearby CIDR prefixes
Frequently asked questions
What subnet mask is /31?
The IPv4 subnet mask for /31 is 255.255.255.254.
How many IP addresses are in a /31?
A /31 contains 2 total IPv4 addresses.
How many usable hosts are in a /31?
A /31 contains two addresses and RFC 3021 allows both to be used on point-to-point links.
Use the interactive calculator below with a real IPv4 address, or open the complete subnetting cheat sheet to compare /31 with every other CIDR size.