Networking · 6 min read · 30 November 2026

Subnet Mask and CIDR Explained, With a /24 to /30 Cheat Sheet

What a subnet mask and CIDR such as /24 mean, how many usable addresses each size gives, and how to plan subnets for staff, guests, cameras and phones.

A subnet mask says which part of an IP address identifies the network and which part identifies the device. CIDR notation writes the same thing as a slash and a number: /24 means the first 24 bits are the network, which is the mask 255.255.255.0.

How many addresses each size gives

A subnet of size /n contains 2(32 − n) addresses. Two are reserved, the network address and the broadcast address, so usable hosts = total − 2.

CIDRSubnet maskAddressesUsable hostsTypical use
/22255.255.252.01,0241,022Large guest Wi-Fi, campus
/23255.255.254.0512510Guest Wi-Fi in a hotel
/24255.255.255.0256254Standard office or device VLAN
/25255.255.255.128128126Cameras or phones on one floor
/26255.255.255.1926462Small team, printers
/27255.255.255.2243230Network management
/28255.255.255.2401614Servers, small DMZ
/30255.255.255.25242Point-to-point links

An example

For 192.168.20.0/24, the network address is 192.168.20.0, the broadcast address is 192.168.20.255 and devices use 192.168.20.1 to 192.168.20.254. The gateway is often .1. Split into two /25s, you get 192.168.20.0–127 and 192.168.20.128–255.

Planning subnets for a site

  • One subnet per VLAN: staff, voice, cameras, guests and management each get their own range. See what is a VLAN.
  • Size for growth: count today's devices and at least double them; guest Wi-Fi needs more because phones keep addresses while they are leased.
  • Use a pattern: for example 10.<site>.<vlan>.0/24, so any address shows the site and the VLAN at a glance.
  • Avoid overlaps: sites joined by VPN must not use the same ranges, and avoid 192.168.0.0/24 and 192.168.1.0/24, which home routers use and which clash with remote workers.

Routing between the subnets is done by the gateway or a Layer 3 switch; see inter-VLAN routing. Addresses are handed out by DHCP.

FAQ

Frequently asked questions

What does /24 mean?

The first 24 bits of the address identify the network. It equals the subnet mask 255.255.255.0 and gives 256 addresses, of which 254 can be used by devices.

Why are two addresses not usable?

The first address identifies the network and the last is the broadcast address. Point-to-point /31 links are a special case where both addresses can be used.

How do I choose a subnet size?

Count the devices that will use the subnet, allow at least double for growth, and pick the smallest size that fits. A /24 is the usual default.

Do subnets need a router?

Yes. Devices in different subnets can only talk through a router, gateway or Layer 3 switch, which is also where firewall rules between them are applied.

Need help designing your network?

Navijin engineers provide free design consultations, bills of materials and quotations for business projects.