📋 Subnet CIDR Cheat Sheet

A full reference table mapping every CIDR prefix to its subnet mask, wildcard mask and usable host count. Filter by minimum prefix to shorten the table.

How each row is built

All three columns come from one 32-bit mask, made by sliding a solid run of 1 bits left until only the host bits are left as zeros:

mask     = 0xFFFFFFFF << (32 - prefix)
wildcard = NOT mask
hosts    = 2^(32 - prefix) - 2    for /0 through /30
         = 2                      for /31  (RFC 3021)
         = 1                      for /32

The /26 row reads 255.255.255.192, wildcard 0.0.0.63, 62 hosts. Mask and wildcard are exact opposites, so each pair of octets adds to 255 - 192 + 63 is the quickest sanity check there is. The /16 row shows 65,534 hosts, because 16 host bits give 65,536 addresses before the network and broadcast come off.

The two prefixes that break the minus-two rule

The "Show from /" box only trims the top of the table. Enter 24 and you get nine rows, /24 down to /32; the /31 and /32 rows are always present, so the sheet never quietly drops the two prefixes that behave differently.

Frequently asked questions

How many hosts are in a /16?

65,534 usable, out of 65,536 addresses. That is the size of a class B network such as 172.16.0.0/16, and the mask is 255.255.0.0.

Can you use a /31 between two routers?

Yes. RFC 3021 defines exactly that case: both addresses in the /31 become the two interface addresses. Most current routers support it, though a few older platforms still refuse to accept the mask.

What does /32 mean in an IP address?

One single address, with the whole 32 bits fixed. It names a specific host rather than a range, which is why access lists, loopbacks and static host routes are written with it.