ToolSec

🌐 Network & IP

Subnetting Cheat Sheet: CIDR, Masks & Host Counts

· 5 min read · Updated June 27, 2026

Once you understand what a subnet is, what you mostly need day to day is a quick reference. Here's the subnetting cheat sheet — the CIDR-to-mask-to-hosts table plus the shortcuts that make it stick.

CIDR → mask → hosts (the table)

The most-used IPv4 prefixes, with their subnet mask, total addresses and usable hosts (total minus the network and broadcast addresses):

CIDRSubnet maskTotalUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422*
/32255.255.255.25511*

* /31 is used for point-to-point links (RFC 3021), where both addresses are usable; /32 describes a single host.

The powers-of-two trick

You don't need to memorise the table — just remember that the host count is a power of two. The number of host bits is 32 − prefix, and the total addresses are 2^(32 − prefix):

  • /24 → 2⁸ = 256
  • /26 → 2⁶ = 64
  • /28 → 2⁴ = 16
  • /30 → 2² = 4

Subtract 2 for usable hosts (network + broadcast) on anything from /24 to /30. Each step up in prefix halves the size; each step down doubles it.

Mask octet values to recognise

The "interesting" octet of a subnet mask is always one of these values, which correspond to how many bits are borrowed: 128, 192, 224, 240, 248, 252, 254, 255. Spotting them tells you the prefix at a glance — a mask ending in .192 is a /26.

The boundary mistake

The classic error is the subnet boundary when the prefix isn't on an octet line. For a /26 (blocks of 64), valid networks are .0, .64, .128, .192 — not .50 or .100. Always align the network address to a multiple of the block size. When in doubt, check it with a calculator.

Private ranges to remember

  • 10.0.0.0/8 — a single huge private block.
  • 172.16.0.0/12 — 172.16.x.x through 172.31.x.x.
  • 192.168.0.0/16 — the home-network favourite.

Check your work

Confirm any subnet instantly with our subnet calculator — it shows the network, broadcast, host range and counts. To translate between CIDR blocks and plain ranges, use the CIDR ↔ IP range converter, and for IPv6 see the IPv6 subnet calculator.

Frequently asked questions

What is the subnet mask for a /26?

255.255.255.192. A /26 has 64 total addresses and 62 usable hosts, with valid network boundaries at .0, .64, .128 and .192.

How do I calculate the number of hosts in a subnet?

Total addresses are 2 to the power of the host bits (32 minus the prefix). Subtract 2 for usable hosts (the network and broadcast addresses). For example a /28 has 2^4 = 16 total and 14 usable.

What are the valid subnet mask octet values?

The interesting octet is always 128, 192, 224, 240, 248, 252, 254 or 255 — each corresponds to a number of borrowed bits, so a mask ending in .192 is a /26.

Try the related tools

Related guides