Subnet for 254 hosts

A network that needs 254 hosts fits in a /24, mask 255.255.255.0, with 254 usable addresses.

254
Hosts needed
/24
Smallest fitting prefix
255.255.255.0
Subnet mask
254
Usable hosts

A network built for exactly 254 hosts fits a /24 with no waste. The mask is 255.255.255.0, and all 254 of its usable addresses are spoken for.

Go one prefix smaller, to a /25, and the block only holds 126 usable addresses, not enough room for 254 hosts. A /24 is the smallest standard block that fits.

Enter any address below to see the exact network, broadcast, and host range for a /24 block.

Calculate a /24 network

Accepts CIDR (192.0.2.0/24), IP + mask (192.0.2.0 255.255.255.0), or a bare IP (defaults to /24).

Network address192.0.2.0
Usable host range192.0.2.1 - 192.0.2.254
Broadcast address192.0.2.255
Usable hosts254
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
CIDR notation192.0.2.0/24
Total addresses256
IP (binary)11000000.00000000.00000010.00000000
Mask (binary)11111111.11111111.11111111.00000000
Try:

Example: 192.0.2.0/24

Taking 192.0.2.0/24 as a worked example, a /24 block breaks down like this:

Network address192.0.2.0
Usable range192.0.2.1 - 192.0.2.254
Broadcast address192.0.2.255
Total addresses256
Usable hosts254

Frequently asked questions

What subnet mask do I need for 254 hosts?

A network with 254 hosts fits in a /24, which uses the mask 255.255.255.0 and provides 254 usable addresses.

How many addresses does a /24 block have in total?

A /24 has 256 total addresses, 254 of them usable (the total minus the network and broadcast addresses, except for /31 and /32).

Is there a smaller subnet that still fits 254 hosts?

No. A /24 has exactly 254 usable addresses, which makes it the smallest standard block that fits 254 hosts without going over.

How do I work this out myself?

Find the smallest power of two, minus two, that is at least 254. That takes 8 host bits, which leaves a /24 prefix. See how to calculate a subnet mask for the full method.