Digital Drive HQ

What Is a /24 Subnet? 256 Addresses, 254 Usable Hosts

·6 min read

A /24 subnet is a network with 24 network bits and 8 host bits. That gives 256 total addresses and 254 usable hosts. The /24 subnet mask is 255.255.255.0, and the wildcard is 0.0.0.255. If you only remember one thing about how many hosts in a /24, remember 254.

Everything below is the reasoning behind those three numbers: where 256 comes from, why you lose two addresses, and why /24 turns up more often than any other prefix. You can check any of it against our IP Subnet Calculator as you read.

How many IPs are in a /24?

256 total. 254 usable. An IPv4 address is 32 bits long. The prefix number after the slash tells you how many of those bits are fixed as the network portion. A /24 fixes 24 bits, which leaves 8 bits free for hosts.

Eight free bits means 2^8 combinations, and 2^8 = 256. Those 256 combinations are every address in the block. Two of them are reserved, which we will get to. So:

  • 32 total bits, minus 24 network bits, equals 8 host bits
  • 2^8 = 256 total addresses
  • 256 minus 2 reserved = 254 usable hosts

The general formula is usable = 2^(32 - prefix) - 2. Plug in 24 and you get 2^8 - 2, which is 254. That same formula works for every prefix, which is why it is worth memorising instead of memorising a table.

What is the /24 subnet mask?

255.255.255.0. The mask is just those 24 network bits written out as an ordinary dotted address. Twenty-four ones followed by eight zeros. Each group of eight ones is 255 in decimal, and eight zeros is 0. So three 255s and a 0.

The wildcard mask is the inverse: 0.0.0.255. You will see wildcards in access control lists and some routing configuration. It marks the bits that are allowed to vary. In a /24 the only bits that vary are the last eight, hence 0.0.0.255.

What does 192.168.1.0/24 actually contain?

This is the block almost everyone meets first. It is a common home and lab example, and it lays the whole idea out cleanly:

  • Network address: 192.168.1.0
  • First usable host: 192.168.1.1
  • Last usable host: 192.168.1.254
  • Broadcast address: 192.168.1.255
  • Subnet mask: 255.255.255.0

Count 0 through 255 and you have 256 addresses. Remove .0 and .255 and you have 254 you can hand to devices. 10.0.0.0/24 behaves identically: network 10.0.0.0, hosts 10.0.0.1 to 10.0.0.254, broadcast 10.0.0.255. The pattern never changes, only the first three numbers do.

Why do you lose two addresses?

Because the all-zeros and all-ones host values are reserved. When every host bit is 0, the address names the network itself. In 192.168.1.0/24 that is 192.168.1.0. It is what a routing table refers to. No device gets it as its own address.

When every host bit is 1, the address is the broadcast address for that network. In our example that is 192.168.1.255. Traffic sent there is meant for every host on the subnet at once. Also not assignable.

So 256 addresses exist, two are spoken for, 254 remain. That subtraction is the -2 in the formula. It applies to a /24 the same way it applies to a /26 or a /30.

Why is /24 so common?

Because 24 lands exactly on an octet boundary. This is the real answer, and it is more interesting than it sounds. An IPv4 address is written as four numbers of eight bits each. A /24 stops at the end of the third one. Nothing is split down the middle.

The practical effect: the network is simply the first three numbers, and the host is the last number. 192.168.1.x means network 192.168.1 and host x. You can read it at a glance. No converting to binary, no working out where a boundary falls inside an octet, no second-guessing which addresses belong together.

Compare that to a /26. There, the boundary sits two bits into the final octet, so 192.168.1.70 and 192.168.1.50 are in different subnets and you cannot see it without doing the math. That readability gap is why home routers, lab guides and documentation examples default to /24. It is not that /24 is technically special. It is that humans can parse it instantly.

The cost is that a /24 is often far bigger than it needs to be. A network with six devices on it still burns 256 addresses. In a small lab nobody cares. At scale it matters, which is where splitting comes in.

How do you split a /24 into smaller subnets?

Every bit you borrow from the host side doubles the number of subnets and roughly halves the hosts in each. Here is the full breakdown of a single /24:

  • Two /25s, 126 usable hosts each
  • Four /26s, 62 usable hosts each
  • Eight /27s, 30 usable hosts each
  • Sixteen /28s, 14 usable hosts each
  • Sixty-four /30s, 2 usable hosts each

Notice the usable counts are not clean halves. Two /25s give 126 + 126 = 252, not 254. That is because each new subnet needs its own network and broadcast address. Split once and you pay the two-address tax twice. Split into sixty-four /30s and you pay it sixty-four times, which is why /30s only make sense for point-to-point links where two usable addresses is exactly right.

If you are sizing a /26 specifically, the sibling breakdown in how many hosts in a /26 subnet walks through that case. For anything else, feed the block into the IP Subnet Calculator and it will lay out every resulting range for you.

What are the neighbours of a /24?

Knowing the prefix on either side helps you place /24 on the scale:

  • /23: mask 255.255.254.0, 512 total addresses, 510 usable. Twice the size of a /24.
  • /24: mask 255.255.255.0, 256 total, 254 usable.
  • /25: mask 255.255.255.128, 128 total, 126 usable. Half a /24.

Each step down the prefix number doubles the block. Each step up halves it. A /23 is two /24s joined together; a /24 is two /25s joined together. Same rule, all the way along. Our subnet mask cheat sheet has the whole ladder from /8 to /32 if you want the full table.

Bottom line

A /24 subnet has 8 host bits, 2^8 = 256 total addresses, and 254 usable hosts once you remove the network and broadcast addresses. The mask is 255.255.255.0. It is the prefix you see everywhere because it stops neatly at an octet boundary, so the first three numbers are the network and the last is the host, readable without any binary. When you need to split one or check an unfamiliar block, run it through the IP Subnet Calculator.

Related guides