UtilityBase logoUtilityBase

2 min read

Subnetting and CIDR Explained

What an IP address and subnet mask really represent, how CIDR notation like /24 maps to host counts, and why networks get carved into subnets at all.

Addresses and the mask

An IPv4 address is 32 bits, usually written as four numbers 0–255 (like 192.168.1.10). A subnet mask splits those 32 bits into two parts: a network portion that identifies which network the address belongs to, and a host portion that identifies the specific device within it. The mask is just a run of 1-bits (network) followed by 0-bits (host) — 255.255.255.0 is twenty-four 1s then eight 0s.

Devices use the mask to decide whether another address is 'local' (same network, talk directly) or 'remote' (send it to the router). Get the mask wrong and two machines that should talk directly instead try to route to each other and fail — which is why subnetting errors show up as 'I can ping some things but not others.'

CIDR notation and host counts

CIDR notation replaces the long mask with a slash and the number of network bits: /24 means 24 network bits, equivalent to 255.255.255.0. The remaining bits are hosts, and the count doubles per bit: a /24 has 8 host bits = 2⁸ = 256 addresses, of which 254 are usable. Two addresses in every subnet are reserved — the first is the network address (all host bits 0) and the last is the broadcast address (all host bits 1) — so usable hosts are always 2^(host bits) − 2.

That gives a quick table: /24 = 254 hosts, /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6. Going the other way, /23 = 510 and /16 = 65,534. Smaller CIDR numbers mean bigger networks (more hosts, fewer networks); larger numbers mean smaller networks. Memorizing the powers of two near the boundary is most of what fast subnetting requires.

  1. 1Open the Subnet Calculator and enter an address with a CIDR suffix, like 192.168.1.0/26.
  2. 2Read the netmask, network address, and broadcast address it derives.
  3. 3Check the usable host range (first usable to last usable) and the host count.
  4. 4Try changing /26 to /27 and watch the network split in half — 62 hosts become 30.
  5. 5Use it to plan how many subnets of a given size fit inside a larger block.

Why bother subnetting

Splitting one big network into smaller subnets does three useful things: it contains broadcast traffic (broadcasts stay within a subnet, so a 1,000-device flat network doesn't drown in chatter), it improves security and control (you can firewall between subnets — put servers, staff, and guest Wi-Fi on separate ones), and it uses address space efficiently (hand each site or department exactly the block it needs instead of wasting a huge range).

This is also why you can't just pick any numbers. Subnets must align to bit boundaries, so a /26 always starts at a multiple of 64 in the last octet (.0, .64, .128, .192). Trying to start a subnet mid-boundary is the classic beginner mistake. The calculator enforces the math, but understanding the boundaries is what lets you design a scheme instead of guessing.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 8 host bits, giving 2⁸ = 256 total addresses, but the first (network address) and last (broadcast address) are reserved, so 256 − 2 = 254 are usable for devices. The same 'minus two' rule applies to every subnet size.

What do the network and broadcast addresses do?

The network address (all host bits 0) names the subnet itself and can't be assigned to a device. The broadcast address (all host bits 1) sends to every host on the subnet at once. Because both are reserved, usable hosts are always 2^(host bits) − 2.

Does a bigger CIDR number mean a bigger network?

No — it's the reverse. A larger CIDR number (like /28) means more network bits and fewer host bits, so a smaller network. A smaller number (like /16) means fewer network bits and many more hosts. /8 is huge; /30 holds just two usable addresses.

Tools mentioned in this guide

Keep reading