Subnet Mask Cheat Sheet

Quick lookup table for subnet masks, CIDR notation, and IP addressing

Subnet Reference Table

CIDRSubnet MaskSubnet Mask (HEX)# of IPsWildcard MaskHost BitsClass
/32255.255.255.255FF.FF.FF.FF10.0.0.00Single Host
/31255.255.255.254FF.FF.FF.FE20.0.0.111/1 C
/30255.255.255.252FF.FF.FF.FC40.0.0.321/2 C
/29255.255.255.248FF.FF.FF.F880.0.0.731/4 C
/28255.255.255.240FF.FF.FF.F0160.0.0.1541/8 C
/27255.255.255.224FF.FF.FF.E0320.0.0.3151/16 C
/26255.255.255.192FF.FF.FF.C0640.0.0.6361/32 C
/25255.255.255.128FF.FF.FF.801280.0.0.12771/64 C
/24255.255.255.0FF.FF.FF.002560.0.0.25581 C
/23255.255.254.0FF.FF.FE.005120.0.1.25592 C
/22255.255.252.0FF.FF.FC.001,0240.0.3.255104 C
/21255.255.248.0FF.FF.F8.002,0480.0.7.255118 C
/20255.255.240.0FF.FF.F0.004,0960.0.15.2551216 C
/19255.255.224.0FF.FF.E0.008,1920.0.31.2551332 C
/18255.255.192.0FF.FF.C0.0016,3840.0.63.2551464 C
/17255.255.128.0FF.FF.80.0032,7680.0.127.25515128 C
/16255.255.0.0FF.FF.00.0065,5360.0.255.255161 B
/15255.254.0.0FF.FE.00.00131,0720.1.255.255172 B
/14255.252.0.0FF.FC.00.00262,1440.3.255.255184 B
/13255.248.0.0FF.F8.00.00524,2880.7.255.255198 B
/12255.240.0.0FF.F0.00.001,048,5760.15.255.2552016 B
/11255.224.0.0FF.E0.00.002,097,1520.31.255.2552132 B
/10255.192.0.0FF.C0.00.004,194,3040.63.255.2552264 B
/9255.128.0.0FF.80.00.008,388,6080.127.255.25523128 B
/8255.0.0.0FF.00.00.0016,777,2160.255.255.255241 A
/7254.0.0.0FE.00.00.0033,554,4321.255.255.255252 A
/6252.0.0.0FC.00.00.0067,108,8643.255.255.255264 A
/5248.0.0.0F8.00.00.00134,217,7287.255.255.255278 A
/4240.0.0.0F0.00.00.00268,435,45615.255.255.2552816 A
/3224.0.0.0E0.00.00.00536,870,91231.255.255.2552932 A
/2192.0.0.0C0.00.00.001,073,741,82463.255.255.2553064 A
/1128.0.0.080.00.00.002,147,483,648127.255.255.25531128 A
/0255.255.255.255FF.FF.FF.FF4,294,967,2960.0.0.032Default Route

Note: The number of usable IP addresses is typically 2 less than the total number of IP addresses shown in the table. This is because the first address (network address) and the last address (broadcast address) are reserved for network identification and broadcast communication respectively. For example, in a /24 subnet with 256 total addresses, only 254 addresses are available for host devices.

What is a Subnet Mask?

A subnet mask is a 32-bit number that divides an IP address into network and host portions. The subnet mask cheat sheet provides quick conversions between CIDR notation and traditional subnet mask format.

Understanding the Subnet Mask Cheat Sheet Table

CIDR Notation (/X)

CIDR (Classless Inter-Domain Routing) notation represents the number of bits used for the network portion of the IP address. For example, /24 means the first 24 bits are used for the network, leaving 8 bits for hosts. The subnet mask cheat sheet shows all possible CIDR values from /0 to /32.

Subnet Mask

The subnet mask is the traditional 32-bit number written in dotted decimal notation (e.g., 255.255.255.0). It defines which portion of an IP address belongs to the network and which belongs to the host. You can quickly convert between CIDR notation and subnet mask format using the subnet mask cheat sheet.

Subnet Mask (HEX)

The subnet mask in hexadecimal format provides an alternative representation of the subnet mask using base-16 notation. This format is often used in network programming, hexadecimal-based configurations, and when working with certain network devices that prefer hex notation. For example, a /24 subnet mask (255.255.255.0) is represented as FF.FF.FF.00 in hexadecimal.

Number of IP Addresses

This column shows the total number of IP addresses available in each subnet. For example, a /24 subnet provides 256 total addresses (254 usable for hosts, plus network and broadcast addresses). The subnet mask cheat sheet helps you quickly determine the size of your network.

Wildcard Mask

The wildcard mask is the inverse of the subnet mask and is commonly used in access control lists (ACLs) and routing protocols. It's calculated by subtracting the subnet mask from 255.255.255.255. The subnet mask cheat sheet includes these for quick reference.

Host Bits

This column indicates the number of bits available for host addressing within the subnet. For example, a /24 subnet has 8 host bits, allowing for 2^8 = 256 total addresses. The subnet mask cheat sheet helps you understand the addressing capacity of each subnet.

Class

The network class column shows the traditional IP address class system and how many networks of that class would fit within the given subnet. For example, a /24 subnet is equivalent to 1 Class C network, while a /16 subnet is equivalent to 256 Class C networks or 1 Class B network. This information helps network administrators understand the scale and scope of their subnetting decisions in terms of traditional class-based networking concepts.

Common Subnet Examples

Most Frequently Used Subnets

  • /24 (255.255.255.0) - Standard Class C subnet with 256 addresses
  • /16 (255.255.0.0) - Class B subnet with 65,536 addresses
  • /8 (255.0.0.0) - Class A subnet with 16,777,216 addresses
  • /30 (255.255.255.252) - Point-to-point links with 4 addresses (2 usable)
  • /32 (255.255.255.255) - Single host route with 1 address

Subnet Mask Calculation

The formula for calculating subnet addresses is: 2^(32-CIDR) = number of addresses. For example, a /24 subnet has 2^(32-24) = 2^8 = 256 addresses.

Formula: 2^(32-CIDR) = Number of Addresses
Example: /24 subnet
2^(32-24) = 2^8 = 256 total addresses
256 - 2 = 254 usable addresses (minus network & broadcast)

References

This subnet mask cheat sheet is based on RFC 1878 - Variable Length Subnet Table For IPv4 (Pummill & Manning, 1995).