Reference January 2025 · 8 min read

Complete IPv4 Subnetting Reference Guide

Everything you need to know about IPv4 subnets in one place.

This is a comprehensive reference for IPv4 subnetting. Bookmark it, print it, keep it handy. Everything you need is on this page.

Subnet Calculator Calculate subnets, masks, and host ranges instantly

CIDR to Subnet Mask Conversion

CIDR Subnet Mask Addresses Usable Hosts
/32255.255.255.25511
/31255.255.255.25422
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/23255.255.254.0512510
/22255.255.252.01,0241,022
/21255.255.248.02,0482,046
/20255.255.240.04,0964,094
/19255.255.224.08,1928,190
/18255.255.192.016,38416,382
/17255.255.128.032,76832,766
/16255.255.0.065,53665,534

Private Address Ranges (RFC 1918)

Range CIDR Total Addresses
10.0.0.0 - 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 - 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 - 192.168.255.255192.168.0.0/1665,536

Special Address Ranges

Range Purpose
127.0.0.0/8Loopback
169.254.0.0/16Link-local (APIPA)
224.0.0.0/4Multicast
240.0.0.0/4Reserved
255.255.255.255/32Broadcast

Quick Formulas

  • Total addresses: 2^(32 - CIDR)
  • Usable hosts: 2^(32 - CIDR) - 2
  • Number of subnets: 2^(new bits borrowed)
  • Network address: First address in range
  • Broadcast address: Last address in range

Subnet Boundaries by CIDR

Networks of a given CIDR size start at multiples of their size:

  • /24: .0 (every 256 addresses)
  • /25: .0, .128 (every 128)
  • /26: .0, .64, .128, .192 (every 64)
  • /27: .0, .32, .64, .96, .128, .160, .192, .224 (every 32)
  • /28: every 16 addresses
  • /29: every 8 addresses
  • /30: every 4 addresses

Wildcard Masks

Used in access lists, a wildcard mask is the inverse of the subnet mask:

Subnet Mask Wildcard Mask
255.255.255.252 (/30)0.0.0.3
255.255.255.0 (/24)0.0.0.255
255.255.0.0 (/16)0.0.255.255
255.0.0.0 (/8)0.255.255.255

Formula: 255.255.255.255 minus subnet mask = wildcard mask

Binary Reference

Useful values for subnet calculations:

Decimal Binary Use
12810000000/25 boundary
19211000000/26 boundary
22411100000/27 boundary
24011110000/28 boundary
24811111000/29 boundary
25211111100/30 boundary
25411111110/31 boundary
25511111111All bits set