CIDR Cheat Sheet

Every prefix length with mask, wildcard and host counts.

Quick converter

Mask in binary

Full prefix reference

CIDRSubnet maskWildcard Total addressesUsable hosts /24sClass equivalent

Reading the table

The prefix length is simply how many leading bits of the address identify the network. Everything else in the row follows from it: the subnet mask is those bits set to 1, the wildcard mask is its exact inverse (what Cisco ACLs and OSPF network statements expect), and the address count is 2 raised to the number of remaining host bits.

Usable hosts is two fewer than the total, because the all-zeros address identifies the network and the all-ones address is the broadcast. The two exceptions sit at the bottom of the table: a /31 gives both addresses to a point-to-point link (RFC 3021), and a /32 is a single host route or loopback.

Prefixes shorter than /8 are included for completeness — they show up in default routes, bogon filters and large aggregates rather than on real interfaces.