Subnetting Made Easy: A Step-by-Step Guide

Subnetting trips up more Network+ and A+ candidates than almost any other topic — but it is really just binary math with a few repeatable steps. This guide walks through subnet masks, CIDR notation, and how to find the network address, broadcast address, and usable host range. Keep our subnet calculator open in another tab to check your work.

What is subnetting?

Subnetting is the practice of splitting one large IP network into smaller logical networks (subnets). It improves performance by limiting broadcast traffic, improves security by isolating segments, and conserves address space. Every IPv4 address has two parts: a network portion and a host portion. The subnet mask decides where the line between them falls.

Subnet masks and CIDR notation

A subnet mask is 32 bits, written as four octets (e.g. 255.255.255.0). Every 1 bit marks the network portion; every 0 bit marks the host portion. CIDR notation (Classless Inter-Domain Routing) is shorthand for the number of 1 bits — so 255.255.255.0 is /24 because the first 24 bits are ones.

CIDRSubnet MaskUsable Hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

The magic number method

For exam speed, find the magic number = 256 minus the "interesting octet" of the mask. Subnets increment by the magic number in that octet. Example: a /26 mask is 255.255.255.192; 256 − 192 = 64. So subnets start at .0, .64, .128, .192.

Worked example

Given 192.168.1.100/26:

  1. Magic number = 256 − 192 = 64.
  2. Subnet blocks: 0–63, 64–127, 128–191, 192–255. Our host (.100) lands in the 64–127 block.
  3. Network address: 192.168.1.64
  4. Broadcast address: 192.168.1.127
  5. Usable host range: 192.168.1.65 – 192.168.1.126 (62 hosts)

Why subtract 2? The first address in each block is the network ID and the last is the broadcast address — neither can be assigned to a host. That is why usable hosts = 2(host bits) − 2.

Common pitfalls

Practice next

Reinforce these steps with hands-on repetition: try the subnet calculator to verify answers, work through Network+ practice questions, and review the OSI model and common ports while you are at it.