Fieldeng
Networking & Communications

IPv4 Host Planner

Smallest IPv4 prefix that can hold the required number of hosts.

Networking & Communications

Smallest IPv4 prefix that can hold the required number of hosts.

App id: NET-03. Reference version 1.0.

How to fill it

Fill the inputs. The tool shows the outputs.

On the tool screen, Calc is the working sheet. Presets stores values you reuse. Reference is the formula, assumptions, and provenance below.

Formula

smallest h with 2^h − 2 ≥ hosts + reserved;  prefix = 32 − h

Inputs

NameUnit
Required hosts1
Reserved addresses (optional)1

Outputs

NameUnit
Recommended prefix (hero result)1
Subnet maskipv4
Total addresses1
Usable addresses1
Unused addresses1

Diagnose

This tool does not attach diagnose observations.

Assumptions

  • Does not assign a network number — only the prefix size.
  • One host maps to /32 and two hosts map to /31 rather than wasting a /30.

Provenance

  • Host-count sizing. /31 and /32 are used for 2-host and 1-host requirements.

On this page