Smallest Prefix Length That Accommodates 50 Hosts

Intermediate Calculate

Question

A department needs a subnet that can support exactly 50 devices. What is the smallest (most specific) CIDR prefix that still provides at least 50 usable host addresses, and how many addresses are wasted?

Given

{
  "required_hosts": 50
}

Answer

{
  "prefix": 26,
  "usable_hosts": 62,
  "wasted": 12
}

Try to solve it first, then click Reveal Answer

Step-by-Step Explanation

Step 1: Find the minimum host bits needed

We need 2^n - 2 >= 50. Check powers of 2:

Host bits (n) Total (2^n) Usable (2^n − 2) Enough?
5 32 30 No (30 < 50)
6 64 62 Yes (62 ≥ 50)

Minimum host bits required = 6.

Step 2: Convert host bits to prefix length

prefix = 32 - host_bits
prefix = 32 - 6 = /26

Step 3: Confirm usable hosts

usable = 2^6 - 2 = 64 - 2 = 62

Step 4: Calculate wasted addresses

wasted = usable - required
wasted = 62 - 50 = 12

These 12 addresses are allocated but unused. This waste is unavoidable because subnet sizes must be powers of 2 — there is no /26.5.

Alternative (too small)

A /27 provides only 2^5 - 2 = 30 usable hosts, which is insufficient for 50 devices.

Summary

Property Value
Required hosts 50
Minimum prefix /26
Usable hosts 62
Wasted addresses 12
Subnet mask 255.255.255.192

Related Terms

More Calculate Worksheets