Home/Cheat Sheets/Subnet Mask

Subnet Mask Cheat Sheet

A quick-reference table mapping CIDR prefix lengths to subnet masks, wildcard masks, total addresses, and usable hosts. Covers the most common subnets from /8 (Class A) down to /32 (host route).

Subnet Mask Cheat Sheet — CIDR to Mask Referencejustprotocols.comCIDRSubnet MaskWildcard Mask# Addresses# Usable HostsExample Use/8255.0.0.00.255.255.25516,777,21616,777,214Class A/10255.192.0.00.63.255.2554,194,3044,194,302Large ISP/12255.240.0.00.15.255.2551,048,5761,048,574172.16.0.0/12/16255.255.0.00.0.255.25565,53665,534Class B/20255.255.240.00.0.15.2554,0964,094Large campus/21255.255.248.00.0.7.2552,0482,046Medium campus/22255.255.252.00.0.3.2551,0241,022Large subnet/23255.255.254.00.0.1.255512510Medium subnet/24255.255.255.00.0.0.255256254Class C / typical LAN/25255.255.255.1280.0.0.127128126Half Class C/26255.255.255.1920.0.0.636462Quarter Class C/27255.255.255.2240.0.0.313230Small office/28255.255.255.2400.0.0.151614Small LAN/29255.255.255.2480.0.0.786Point-to-multipoint/30255.255.255.2520.0.0.342Point-to-point link/31255.255.255.2540.0.0.122P2P (RFC 3021)/32255.255.255.2550.0.0.011Host routeHighlighted row (/24) is the most commonly used subnet size. Usable hosts = total addresses - 2 (network + broadcast), except /31 and /32.
Subnet mask reference table mapping CIDR prefix lengths to subnet masks, wildcard masks, total addresses, and usable host counts. The /24 row is highlighted as the most common subnet size.

How to Read This Table

CIDR Notation (e.g. /24)
The number after the slash indicates how many bits of the 32-bit IPv4 address are used for the network portion. A /24 means the first 24 bits identify the network, leaving 8 bits for host addresses.
Subnet Mask
The dotted-decimal representation of the network bits. Each network bit is set to 1. For /24, the first 24 bits are all 1s, giving 255.255.255.0.
Wildcard Mask
The bitwise inverse of the subnet mask. Used in access control lists (ACLs) on Cisco routers and OSPF network statements. For /24, the wildcard mask is 0.0.0.255.
Relationship
Total addresses = 2(32 - prefix length). Usable hosts = total addresses - 2 (one address reserved for the network ID, one for the broadcast). The exceptions are /31 (RFC 3021 point-to-point links with 2 usable addresses) and /32 (a single host route).

Private IP Ranges (RFC 1918)

Three address blocks are reserved for private networks and are not routable on the public internet.

  • 10.0.0.0/8Mask 255.0.0.0 — 16,777,216 addresses. Used for large enterprise networks.
  • 172.16.0.0/12Mask 255.240.0.0 — 1,048,576 addresses. Covers 172.16.0.0 through 172.31.255.255.
  • 192.168.0.0/16Mask 255.255.0.0 — 65,536 addresses. The most common home and small office range.

Need to Calculate a Specific Subnet?

Enter any IP address and prefix length to see the network address, broadcast address, host range, and more.

Calculate any subnet