Skip to content

Subnetting for beginners: CIDR, masks, and usable hosts

Last updated: March 20, 2026 · Includes worked examples and common mistakes.

Subnetting feels hard until you realize it’s mostly two questions:

  1. How many addresses are in this subnet?
  2. What is the network/broadcast range for a given IP and prefix?

Once you can answer those, you can design networks, avoid overlapping ranges, and write firewall rules that do what you actually intend. This guide is written for beginners and focuses on practical understanding rather than memorizing tables.

1) IPv4 addresses are 32 bits (the dots are just formatting)

An IPv4 address like 192.168.1.10 is four numbers separated by dots. Each number is a byte (8 bits), so the full address is 32 bits. Subnetting is the process of deciding how many of those bits identify the network versus the host.

2) CIDR prefix: “/24” means 24 network bits

A CIDR prefix is the /number part. The prefix tells you how many bits are “fixed” for the network. The remaining bits are host bits.

  • /24 → 24 network bits, 8 host bits
  • /26 → 26 network bits, 6 host bits
  • /30 → 30 network bits, 2 host bits

Host bits determine the size. With h host bits, the subnet has 2^h total addresses.

3) Subnet mask: the same idea as the prefix, written as dotted decimals

A subnet mask is another way to represent the prefix. A /24 mask is 255.255.255.0. A /26 mask is 255.255.255.192. You do not need to memorize masks if you have a calculator, but it helps to recognize the common ones.

4) Network address, broadcast address, and “usable hosts”

In many traditional IPv4 subnets:

  • The network address is the first address in the range (all host bits = 0).
  • The broadcast address is the last address in the range (all host bits = 1).
  • Usable hosts are the addresses in between.

That’s why “usable hosts” is often total addresses − 2. (There are exceptions such as /31 point‑to‑point usage and /32 single‑host routes.)

5) Worked example: 192.168.1.10/24

With /24, there are 8 host bits. Total addresses = 2^8 = 256. Usable hosts are typically 256 − 2 = 254.

The range is:

  • Network address: 192.168.1.0
  • Broadcast address: 192.168.1.255
  • Usable hosts: 192.168.1.1 to 192.168.1.254

If you’ve ever seen home routers using 192.168.1.x, this is why it’s common: it’s a tidy subnet with room for many devices.

6) Worked example: splitting a /24 into four equal subnets

Suppose you have 10.0.5.0/24 and want 4 equal subnets. Four subnets means you need 2 extra network bits (because 2^2 = 4). So you move from /24 to /26.

A /26 has 6 host bits: total addresses 2^6 = 64 per subnet, usable hosts typically 62.

The four /26 networks inside the /24 are:

  • 10.0.5.0/26 (addresses .0 to .63)
  • 10.0.5.64/26 (addresses .64 to .127)
  • 10.0.5.128/26 (addresses .128 to .191)
  • 10.0.5.192/26 (addresses .192 to .255)

This “block size” pattern is why people memorize some masks: for /26, blocks increment by 64 in the last octet.

7) Common subnet sizes (you’ll see these often)

You don’t need to memorize everything, but recognizing a few is valuable:

  • /24 → 254 usable hosts
  • /25 → 126 usable hosts
  • /26 → 62 usable hosts
  • /27 → 30 usable hosts
  • /28 → 14 usable hosts
  • /29 → 6 usable hosts
  • /30 → 2 usable hosts

The IP Subnet Calculator on this site includes a classful cheat sheet table so you can look these up quickly.

8) Mistakes that cause real outages

  • Overlapping subnets: two networks that share addresses will create routing ambiguity.
  • Using the wrong prefix in firewall rules: a /16 rule is massively wider than a /24 rule.
  • Forgetting “usable host” constraints: a /30 is not a general-purpose LAN subnet.
  • Assuming “classful” rules apply everywhere: modern networks use CIDR; class labels are historical shortcuts.

9) Use a calculator to stay fast and accurate

In practice, the quickest workflow is:

  1. Enter the IP and prefix.
  2. Copy the computed network range into documentation or firewall tickets.
  3. Sanity-check usable hosts for DHCP pools.

For our sourcing and corrections standards, see the Editorial & Accuracy Policy.

Reminder
Always confirm whether a subnet is intended for routing, point‑to‑point, or a LAN. Using an overly broad prefix in a firewall rule can unintentionally expose services.