subnetting February 1, 2026

IPv4 Subnetting Cheat Sheet — Complete Reference for Network Engineers

Complete IPv4 subnetting reference with all subnet masks, CIDR notation, usable hosts, wildcard masks, and binary representations from /1 to /32.

IPv4 Subnetting Cheat Sheet

Every network engineer needs a reliable reference for subnetting. This guide covers every prefix length from /1 to /32, explains the math behind the formulas, and provides practical context for real-world network design decisions.

The Complete /1 to /32 Reference Table

CIDRSubnet maskWildcard maskTotal addressesUsable hostsHost bits
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,64631
/2192.0.0.063.255.255.2551,073,741,8241,073,741,82230
/3224.0.0.031.255.255.255536,870,912536,870,91029
/4240.0.0.015.255.255.255268,435,456268,435,45428
/5248.0.0.07.255.255.255134,217,728134,217,72627
/6252.0.0.03.255.255.25567,108,86467,108,86226
/7254.0.0.01.255.255.25533,554,43233,554,43025
/8255.0.0.00.255.255.25516,777,21616,777,21424
/9255.128.0.00.127.255.2558,388,6088,388,60623
/10255.192.0.00.63.255.2554,194,3044,194,30222
/11255.224.0.00.31.255.2552,097,1522,097,15021
/12255.240.0.00.15.255.2551,048,5761,048,57420
/13255.248.0.00.7.255.255524,288524,28619
/14255.252.0.00.3.255.255262,144262,14218
/15255.254.0.00.1.255.255131,072131,07017
/16255.255.0.00.0.255.25565,53665,53416
/17255.255.128.00.0.127.25532,76832,76615
/18255.255.192.00.0.63.25516,38416,38214
/19255.255.224.00.0.31.2558,1928,19013
/20255.255.240.00.0.15.2554,0964,09412
/21255.255.248.00.0.7.2552,0482,04611
/22255.255.252.00.0.3.2551,0241,02210
/23255.255.254.00.0.1.2555125109
/24255.255.255.00.0.0.2552562548
/25255.255.255.1280.0.0.1271281267
/26255.255.255.1920.0.0.6364626
/27255.255.255.2240.0.0.3132305
/28255.255.255.2400.0.0.1516144
/29255.255.255.2480.0.0.7863
/30255.255.255.2520.0.0.3422
/31255.255.255.2540.0.0.122*1
/32255.255.255.2550.0.0.011*0

*Special cases — see the RFC 3021 and host route sections below.

How to Read CIDR Notation

CIDR (Classless Inter-Domain Routing) notation expresses a network as an IP address followed by a forward slash and the prefix length. The prefix length tells you how many leading bits of the address are fixed (the network portion); the remaining bits identify individual hosts.

For example, 192.168.10.0/24 means:

  • The first 24 bits (192.168.10) identify the network.
  • The last 8 bits (.0 through .255) are available for hosts.
  • Network address: 192.168.10.0
  • Broadcast address: 192.168.10.255
  • Usable hosts: 192.168.10.1 through 192.168.10.254 (254 hosts)

The Formula for Usable Hosts

The number of usable host addresses in any subnet is:

Usable hosts = 2^h - 2

where h is the number of host bits (32 minus the prefix length).

The two subtracted addresses are the network address (all host bits set to 0) and the broadcast address (all host bits set to 1). For a /24, that is 2^8 − 2 = 254 usable hosts.

RFC 1918 Private Address Ranges

These three blocks are reserved for private networks and must never be routed on the public internet:

RangeCIDRSubnet maskUsable hosts
10.0.0.0 – 10.255.255.25510.0.0.0/8255.0.0.016,777,214
172.16.0.0 – 172.31.255.255172.16.0.0/12255.240.0.01,048,574
192.168.0.0 – 192.168.255.255192.168.0.0/16255.255.0.065,534

The 10.0.0.0/8 block is the most flexible for large enterprise deployments. A typical design allocates /8 per organisation, /12 per region, /16 per site, /24 per VLAN — leaving room for growth at every level.

Special Prefix Lengths

A /31 subnet contains exactly two addresses. Classically both would be reserved (network and broadcast), making it unusable. RFC 3021 (published in 2000) formally permits using both addresses as host addresses on point-to-point links. This halves the address waste on WAN links compared to /30.

On Cisco IOS, /31 works without special configuration since IOS 12.2. Many operators still use /30 for clarity, but /31 is valid and saves IPv4 space:

interface Serial0/0/0
 ip address 10.1.1.0 255.255.255.254

The peer uses 10.1.1.1 255.255.255.254. No broadcast address exists; both addresses are host-usable.

/32 — Host Routes

A /32 mask identifies a single host. It appears in routing tables as a host route and is the standard for:

  • Loopback interfaces on routers (interface Loopback0 / ip address 10.255.0.1 255.255.255.255)
  • Redistributing specific host routes from a routing protocol
  • Null routes used as traffic black holes
  • BGP next-hop addresses

You cannot have multiple hosts in a /32 — it is one address, one host.

Binary Representation of Common Octets

When working with subnet masks, the last interesting octet is always one of eight possible values. Understanding their binary form lets you identify network and host boundaries immediately:

DecimalBinaryBits usedUsed in prefix
128100000001/9, /17, /25
192110000002/10, /18, /26
224111000003/11, /19, /27
240111100004/12, /20, /28
248111110005/13, /21, /29
252111111006/14, /22, /30
254111111107/15, /23, /31
255111111118/8, /16, /24, /32

To find the network address from any IP and mask: perform a bitwise AND between the IP address and the subnet mask. To find the broadcast address: set all host bits to 1 (OR the network address with the wildcard mask).

Class-Based Address Ranges (Historical Context)

Before CIDR, IPv4 was divided into fixed classes. Understanding them helps when reading older documentation:

ClassRangeDefault maskTypical use
A1.0.0.0 – 126.255.255.255/8 (255.0.0.0)Large organisations, ISPs
B128.0.0.0 – 191.255.255.255/16 (255.255.0.0)Mid-size organisations
C192.0.0.0 – 223.255.255.255/24 (255.255.255.0)Small networks
D224.0.0.0 – 239.255.255.255N/AMulticast
E240.0.0.0 – 255.255.255.255N/AExperimental/reserved

Note that 127.x.x.x is reserved for loopback and is not a valid Class A network. 169.254.x.x (Class B space) is reserved for APIPA (Automatic Private IP Addressing).

Practical Examples by Prefix Length

Designing for 200 hosts: You need at least 202 addresses (200 hosts + network + broadcast). A /24 gives 254 usable hosts — the correct choice. A /25 only provides 126 usable hosts, which is insufficient.

Designing a /22 office block: 10.4.0.0/22 covers 10.4.0.0 through 10.4.3.255 — 1,024 addresses, 1,022 usable. This can be divided into four /24 VLANs: 10.4.0.0/24, 10.4.1.0/24, 10.4.2.0/24, 10.4.3.0/24, each with 254 usable hosts.

WAN link economy: Use /30 for router-to-router links where only two hosts are needed. 10.1.0.0/30 gives you .1 and .2 as usable addresses with .0 as network and .3 as broadcast. For maximum efficiency, use /31 per RFC 3021.

Loopback addressing: Assign a /32 from a dedicated block, for example 10.255.0.0/24 reserved for loopbacks. Router R1 gets 10.255.0.1/32, R2 gets 10.255.0.2/32. These are reachable across the network but consume no subnet space.

Wildcard Mask Quick Reference

Wildcard masks are the inverse of subnet masks and appear in OSPF network statements and Cisco ACLs. To calculate a wildcard mask, subtract the subnet mask from 255.255.255.255:

Subnet maskWildcard maskUsed for
255.255.255.0 (/24)0.0.0.255Match entire /24
255.255.255.128 (/25)0.0.0.127Match half of /24
255.255.255.252 (/30)0.0.0.3Match /30 link
255.255.255.255 (/32)0.0.0.0Match single host
255.0.0.0 (/8)0.255.255.255Match Class A block

In OSPF network statements, 0.0.0.255 means “match any address in this /24 block, regardless of the last octet.” The wildcard 0.0.0.0 means “match this exact address only” — the host-specific form.

← All articles