Subnet for 5 hosts

A network that needs 5 hosts fits in a /29, mask 255.255.255.248, with 6 usable addresses.

5
Hosts needed
/29
Smallest fitting prefix
255.255.255.248
Subnet mask
6
Usable hosts

A network built for 5 hosts needs a /29. The mask is 255.255.255.248, and its 6 usable addresses leave 1 spare for growth.

The next smaller block, a /30, only allows 2 usable addresses, which is not enough for 5 hosts. That makes /29 the smallest block that fits.

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

Calculate a /29 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.6
Broadcast address192.0.2.7
Usable hosts6
Subnet mask255.255.255.248
Wildcard mask0.0.0.7
CIDR notation192.0.2.0/29
Total addresses8
IP (binary)11000000.00000000.00000010.00000000
Mask (binary)11111111.11111111.11111111.11111000
Try:

Example: 192.0.2.0/29

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

Network address192.0.2.0
Usable range192.0.2.1 - 192.0.2.6
Broadcast address192.0.2.7
Total addresses8
Usable hosts6

Frequently asked questions

What subnet mask do I need for 5 hosts?

A network with 5 hosts fits in a /29, which uses the mask 255.255.255.248 and provides 6 usable addresses.

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

A /29 has 8 total addresses, 6 of them usable (the total minus the network and broadcast addresses, except for /31 and /32).

Does a /29 waste any addresses for 5 hosts?

Yes, 1 address of headroom. A /29 provides 6 usable addresses for the 5 you need, and the next smaller block, a /30, does not hold enough.

How do I work this out myself?

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