taap.digitalnetwork engineering toolkit

/24 subnet mask: how many hosts?

Answer
255.255.255.0 /24 · 254 usable hosts

A /24 prefix is the mask 255.255.255.0. It leaves 8 host bits: 256 addresses in total and 254 usable hosts (network and broadcast excluded).

subnet4 · adjust the values
Accepts 10.0.0.1/8, 10.0.0.1 255.0.0.0 or just the IP with the prefix below.
Close-up of a network switch with ports and lights
Close-up of a network switch with ports and lights. Photo: Jonathan Castañeda / Unsplash

/24 at a glance

ItemValue
Mask255.255.255.0
Wildcard0.0.0.255
Addresses256
Usable hosts254
Mask in binary11111111.11111111.11111111.00000000
Example network192.168.1.0/24

Neighboring prefixes

PrefixMaskUsable hosts
/23255.255.254.0510
/24255.255.255.0254
/25255.255.255.128126

To work out another address with this prefix, change the IP in the calculator above: you get network, broadcast and range in binary.

Step by step

  1. Host bits: 32 − 24 = 8.
  2. Addresses: 28 = 256.
  3. Usable hosts: 256 − 2 (network and broadcast) = 254.
  4. The prefix ends exactly on an octet boundary: 3 octet(s) at 255 and the rest at 0. Networks step by 1 in octet 3.

Example with 192.168.1.0/24

ItemAddress
Network192.168.1.0/24
First host192.168.1.1
Last host192.168.1.254
Broadcast192.168.1.255

Nearby prefixes

PrefixMaskUsable hosts
/21255.255.248.02,046
/22255.255.252.01,022
/23255.255.254.0510
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430

In practice

Going from /24 to /23 doubles the block to 512 addresses (510 usable hosts); going to /25 halves it to 126 usable hosts.

To try other values, open the IPv4 subnet calculator with these numbers already filled in.

More questions like this

Frequently asked questions

Why subtract 2 hosts?

The first address identifies the network and the last is the broadcast; neither can be assigned to a device. On /31 links (RFC 3021) both are used.

How do I configure it on Cisco?

With the dotted mask: ip address 192.168.10.1 255.255.255.0. ACLs and OSPF use the wildcard 0.0.0.255.