# /31 Subnet Mask (255.255.255.254) – Hosts, Range & FAQ

> The /31 subnet mask is 255.255.255.254. A /31 block holds 2 addresses with 2 usable hosts — ranges, wildcard, binary math and FAQs.

- Page URL: https://itinsighthub.com/subnet/31/
- Markdown variant of this page: append `?format=md` to any URL on this site or send `Accept: text/markdown`.
- Full site index for AI assistants: https://itinsighthub.com/llms.txt
- Full site export: https://itinsighthub.com/llms-full.txt

# /31 Subnet Mask ReferenceIPv4

Two addresses, both usable: the /31 turns the old WAN-link tax into a rounding error. RFC 3021 blessed this format for point-to-point links, and every modern routing platform speaks it fluently.

The /31 subnet mask is 255.255.255.254, equivalent to 0.0.0.1 as a wildcard. A /31 block contains 2 IP addresses (2 usable hosts, both usable on a point-to-point link).

## /31 facts at a glance

- **Subnet mask:** 255.255.255.254
- **Wildcard mask:** 0.0.0.1
- **Binary mask:** 11111111.11111111.11111111.11111110
- **Total addresses:** 2
- **Usable hosts:** 2 (point-to-point per RFC 3021)
- **Block size:** 2 addresses (21)
- **Typical role:** Point-to-point links (RFC 3021)

## Example /31 networks

Three consecutive /31 blocks, starting at the /31 boundary that contains 198.51.100.0:

| Network | Usable range | Usable hosts |
| --- | --- | --- |
| 198.51.100.0/31 | 198.51.100.0 | 2 |
| 198.51.100.2/31 | 198.51.100.2 | 2 |
| 198.51.100.4/31 | 198.51.100.4 | 2 |

## How to calculate a /31 mask

A /31 mask sets the first 31 bits of a 32-bit number to 1 and leaves the remaining 1 bits as 0. In binary that reads `11111111.11111111.11111111.11111110`, which converts to dotted decimal `255.255.255.254`. Each block covers a contiguous run of 21 = 2 addresses, and every block starts at a multiple of that size. The wildcard simply flips every bit, giving `0.0.0.1`.

## Where /31 is used

- Router-to-router transit links running OSPF or iBGP across a dedicated wire or tunnel.
- Modern replacements for /30 WAN circuits, halving address consumption overnight.
- Conserving public IPv4 space on interconnects where every address counts.

RFC 3021 removes the network/broadcast requirement for /31s on point-to-point links, so both addresses become ordinary interface addresses.

Only two-device links qualify. Anything with more speakers, such as shared Ethernet or Wi-Fi, still needs /30 or wider.

## Frequently asked questions

**Is /31 valid on Ethernet?**

Yes, when exactly two devices share the segment. RFC 3021 defines /31 behavior specifically for point-to-point links, and Ethernet between two routers qualifies.

**How many usable hosts are in a /31?**

Both of them. Unlike every other prefix below /31, there is no deduction: two total addresses, two usable.

**What is the subnet mask for a /31?**

255.255.255.254, wildcard 0.0.0.1: a single host bit distinguishes the two endpoints.

**Do routing protocols work over /31 links?**

OSPF and BGP sessions over /31 transit links are standard practice on current router and firewall platforms.

## Open this block in a calculator

[Open the /31 block in the subnet calculator](https://itinsighthub.com/subnet-calculator/?q=198.51.100.0%2F31)

[Get the /31 wildcard mask →](https://itinsighthub.com/wildcard-mask-calculator/?q=%2F31)

### Related prefixes

[/24](https://itinsighthub.com/subnet/24/)[/26](https://itinsighthub.com/subnet/26/)[/28](https://itinsighthub.com/subnet/28/)[/30](https://itinsighthub.com/subnet/30/)[/32](https://itinsighthub.com/subnet/32/)

← /30 subnet mask
/32 subnet mask →

---

© 2026 ITInsightHub · [About](https://itinsighthub.com/about/) · [Contact](https://itinsighthub.com/contact/) · [Privacy](https://itinsighthub.com/privacy/)
