Subnetting Cheat Sheet

Complete reference for IPv4 subnetting. All CIDR prefixes from /0 to /32 with subnet masks, wildcard masks, total hosts, and usable host counts.

All CIDR Prefixes /0 to /32

CIDRSubnet MaskWildcard MaskTotal HostsUsable HostsClass
/00.0.0.0255.255.255.2554295.0M4294967294A
/1128.0.0.0127.255.255.2552147.5M2147483646A
/2192.0.0.063.255.255.2551073.7M1073741822A
/3224.0.0.031.255.255.255536.9M536870910A
/4240.0.0.015.255.255.255268.4M268435454A
/5248.0.0.07.255.255.255134.2M134217726A
/6252.0.0.03.255.255.25567.1M67108862A
/7254.0.0.01.255.255.25533.6M33554430A
/8255.0.0.00.255.255.25516.8M16777214A
/9255.128.0.00.127.255.2558.4M8388606B
/10255.192.0.00.63.255.2554.2M4194302B
/11255.224.0.00.31.255.2552.1M2097150B
/12255.240.0.00.15.255.2551.0M1048574B
/13255.248.0.00.7.255.255524.3K524286B
/14255.252.0.00.3.255.255262.1K262142B
/15255.254.0.00.1.255.255131.1K131070B
/16255.255.0.00.0.255.25565.5K65534B
/17255.255.128.00.0.127.25532.8K32766C
/18255.255.192.00.0.63.25516.4K16382C
/19255.255.224.00.0.31.2558.2K8190C
/20255.255.240.00.0.15.2554.1K4094C
/21255.255.248.00.0.7.2552.0K2046C
/22255.255.252.00.0.3.2551.0K1022C
/23255.255.254.00.0.1.255512510C
/24255.255.255.00.0.0.255256254C
/25255.255.255.1280.0.0.127128126—
/26255.255.255.1920.0.0.636462—
/27255.255.255.2240.0.0.313230—
/28255.255.255.2400.0.0.151614—
/29255.255.255.2480.0.0.786—
/30255.255.255.2520.0.0.342—
/31255.255.255.2540.0.0.120—
/32255.255.255.2550.0.0.010—

Common CIDR Notations

CIDRSubnet MaskWildcard MaskTotal IPsUsable HostsCommon Use
/16255.255.0.00.0.255.25565,53665,534Large network / VPC
/23255.255.254.00.0.1.255512510Multi-site VLAN
/24255.255.255.00.0.0.255256254Standard LAN segment
/25255.255.255.1280.0.0.127128126Small LAN / VLAN
/26255.255.255.1920.0.0.636462Small network segment
/27255.255.255.2240.0.0.313230Tiny network
/28255.255.255.2400.0.0.151614DMZ / small VLAN
/29255.255.255.2480.0.0.786Point-to-point (6 hosts)
/30255.255.255.2520.0.0.342P2P link
/31255.255.255.2540.0.0.122P2P (no broadcast)
/32255.255.255.2550.0.0.011Single host / loopback

IPv6 Quick Reference

PrefixSubnetsDescription
/6418,446,744,073,709,551,616Standard subnet size (SLAAC-enabled)
/56256 × /64Typical customer allocation
/4865,536 × /64Typical site allocation
/441,048,576 × /64Large site allocation
/324,294,967,296 × /64Typical ISP allocation
/2868,719,476,736 × /64Large ISP / LIR allocation

Understanding the Subnetting Cheat Sheet

This cheat sheet provides a complete reference for IPv4 and IPv6 subnetting. Every CIDR prefix from /0 through /32 is listed with its corresponding subnet mask, wildcard mask, total number of IP addresses, and usable host count. Understanding these values is fundamental to IP network design, whether you are building a home lab, an enterprise network, or cloud infrastructure on AWS, Azure, or Google Cloud.

How to Read the Tables

The subnet mask is a 32-bit number that divides the IP address into the network portion (the 1-bits) and the host portion (the 0-bits). For example, a /24 prefix has a subnet mask of 255.255.255.0, meaning the first 24 bits identify the network and the remaining 8 bits identify hosts on that network. The wildcard mask is the bitwise inverse of the subnet mask and is used in access control lists (ACLs) and routing protocols such as OSPF and EIGRP to match ranges of IP addresses.

The total hosts column shows every IP address in the subnet, including the network address (all host bits zero) and the broadcast address (all host bits one). The usable hostscolumn subtracts these two reserved addresses to show how many addresses are available for assigning to devices. The two notable exceptions are /31 (used for point-to-point links where broadcast is unnecessary) and /32 (used for single-host loopback interfaces), where all addresses are usable.

Choosing the Right Prefix

Selecting the appropriate CIDR prefix depends on the number of devices you need to support. A /24 (256 addresses) is the standard for most LAN segments. Use /28 or /29 for small VLANs and DMZs where you only need a handful of addresses. A /30 is the classic point-to-point link size, providing exactly two usable IPs for router interfaces. In cloud environments, AWS VPC subnets typically start at /16 (the entire VPC) and break down into /24 or /20 subnets per availability zone.

For IPv6, the standard subnet size is always /64, which provides an enormous 18 quintillion addresses per subnet — enough for SLAAC (Stateless Address Autoconfiguration) to work. ISPs typically receive a /32 prefix, which gives them over 4 billion /64 subnets to allocate to customers. Enterprises usually receive a /48 prefix, providing 65,536 /64 subnets. This makes IPv6 subnetting far simpler than IPv4: you never need to calculate host counts, you just allocate /64s.

Use this cheat sheet alongside the Subnet Calculator for detailed calculations, or the Subnetting Quiz to test your knowledge.