0PricingLogin
Network+ Academy · Lesson

Counting Hosts in a Subnet

Calculate how many usable addresses a subnet provides.

Hosts Come From Host Bits

The number of addresses in a subnet depends entirely on the host bits — the 0 bits in the mask. The more host bits, the more addresses.

If you know the prefix, you know the host bits: subtract the prefix from 32. A /24 has 32 minus 24 = 8 host bits.

The Power of Two Formula

The total number of addresses in a subnet is 2 to the power of the host bits. With 8 host bits, that is 2^8 = 256 total addresses.

This count includes every possible combination of host bits, from all zeros to all ones — including the special network and broadcast addresses.

total = 2 ^ (32 - prefix)
/24 -> 2 ^ 8 = 256

All lessons in this course

  1. What a Subnet Mask Does
  2. Reading CIDR Slash Notation
  3. Counting Hosts in a Subnet
  4. Splitting a Network Into Subnets
← Back to Network+ Academy