Skip to main content
IP Range CalculatorPRO
IPv4 Subnetting & RangeInstant Client-Side Tool

Host Requirement to Prefix Calculator

Find a prefix meeting capacity requirements.

Host Requirement to Prefix Calculator: inputs and results

Enter an IP address, CIDR prefix, or range. Then check its first and last address below.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

How Host Requirement to Prefix Calculator Works?

This tool works by finding the smallest number of host bits whose usable capacity meets or exceeds the requested host count, then subtracting that number from 32.

  1. Enter the required hosts

    Type the device count, for example 50 hosts.

  2. Add the 2 reserved addresses

    The calculator adds the network and broadcast addresses: 50 + 2 = 52.

  3. Round up to the next exponent of 2

    The next value of 2^h at or above 52 is 64, so h = 6 host bits.

  4. Return the prefix

    Prefix = 32 − 6 = /26, which gives 62 usable hosts and 12 spare addresses.

Host Requirement to Prefix Calculator Formula

The formula is Prefix = 32 − ceil(log2(Hosts + 2)).

Host bits required

h = ceil(log2(N + 2))

N is the number of hosts required.

Prefix length

p = 32 − h

The longest prefix that still fits N hosts.

Capacity provided

Capacity = 2^h − 2

The usable hosts in the chosen prefix.

Spare addresses

Spare = Capacity − N

Room left for growth.

Worked example: 500 hosts

N + 2      = 502
log2(502)  = 8.97 → ceil = 9 host bits
Prefix     = 32 − 9 = /23
Capacity   = 2^9 − 2 = 510 hosts
Spare      = 510 − 500 = 10 addresses

Host Requirement to Prefix Calculator Conversion Table

The table shows the minimum prefix for 17 common host requirements, with the capacity and spare addresses of each result.

Hosts RequiredHost BitsMinimum PrefixSubnet MaskCapacitySpare
22/30255.255.255.25220
53/29255.255.255.24861
104/28255.255.255.240144
144/28255.255.255.240140
255/27255.255.255.224305
305/27255.255.255.224300
506/26255.255.255.1926212
626/26255.255.255.192620
1007/25255.255.255.12812626
1267/25255.255.255.1281260
2008/24255.255.255.025454
2548/24255.255.255.02540
5009/23255.255.254.051010
1,00010/22255.255.252.01,02222
2,00011/21255.255.248.02,04646
4,00012/20255.255.240.04,09494
10,00014/18255.255.192.016,3826,382

What is Host Requirement to Prefix Calculator?

The Host Requirement to Prefix Calculator is a tool that returns the smallest IPv4 subnet prefix able to hold a given number of hosts. 50 hosts need a /26, and 500 hosts need a /23.

Subnet sizes grow in steps of 2. A requirement of 63 hosts does not fit a /26 (62 usable) and jumps to a /25 (126 usable). The Host Requirement to Prefix Calculator finds that step boundary for any count up to 4,294,967,294 hosts.

The tool uses the standard reservation of 2 addresses per subnet. Cloud subnets reserve more addresses per subnet, and the AWS VPC Subnet Capacity Calculator and the Custom Cloud Subnet Calculator handle those rules.

What are the uses of Host Requirement to Prefix Calculator?

There are 5 main uses of the Host Requirement to Prefix Calculator, including VLAN sizing, VLSM planning, and growth buffers.

  • Sizing VLANs by headcount

    A department with 90 devices gets a /25 (126 hosts), not a /24 (254 hosts), which keeps address space free.

  • Ordering VLSM allocations

    Variable Length Subnet Masking (VLSM) plans start with the largest host requirement. The calculator returns the prefix for each requirement.

  • Adding a growth buffer

    Teams add 20 % to 30 % to the current count before sizing. 80 devices plus 25 % = 100 hosts → /25.

  • Requesting address space

    Requests to an IPAM team or RIR state a prefix size. The calculator converts device counts into that size.

  • Answering subnetting exam questions

    Exams ask for "the mask that supports N hosts". The calculator returns the mask and the prefix.