Number Of Subnets Needed Calculator
Work out number of subnets needed instantly with clear inputs, formula shown and shareable results.
About Number Of Subnets Needed Calculator
Subnetting borrows bits from the host field: borrowing b bits creates 2^b subnets and leaves 32 - prefix - b host bits. The number of bits to borrow is therefore ceil(log2(subnets needed)), and the resulting host capacity must still cover the largest subnet's requirement.
Formula
Bits to borrow
b = ceil(log2(subnets required)); new prefix = base prefix + b; hosts per subnet = 2^(32 - new prefix) - 2
Worked example
With the default values below, Number Of Subnets Needed Calculator returns New subnet prefix of 21. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Starting prefix (/n)accepts 8–30 bits
- 16 bits
- Subnets requiredminimum 1
- 20
- Hosts required per subnetminimum 1
- 100
Results
- New subnet prefix
- 21 /n
- Bits borrowed from the host field
- 5 bits
- Subnets created
- 32
- Usable hosts per subnet
- 2,046
Step by step
- 1Values used
- 2Bits to borrow
- 3New subnet prefix= 21 /n
- 4Bits borrowed from the host field= 5 bits
- 5Subnets created= 32
- 6Usable hosts per subnet= 2,046
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why does asking for 20 subnets give 32?
Subnets come in powers of two. Five borrowed bits give 32 subnets, which is the smallest power of two that covers 20, and the spare 12 are growth room.
What if hosts per subnet come out too small?
You are trying to fit too much into the block. Either start from a shorter base prefix or use VLSM so only the small subnets get long prefixes.
Related Calculators
- ARP Table Size Calculator
- Broadcast Domain Size Calculator
- Collision Domain Count Calculator
- DHCP Lease Time Calculator
- DHCP Pool Size Calculator
- Dual Stack Addressing Plan Calculator
- First And Last Usable IP Calculator
- Host Bits Required Calculator
- IP Address Class Calculator
- IP Address Plan For Sites Calculator
You might also need
- IP To Hexadecimal CalculatorAlso in IP Addressing & Subnetting
- IP Address Class CalculatorAlso in IP Addressing & Subnetting
- IP Range To CIDR CalculatorAlso in IP Addressing & Subnetting
- IPv6 EUI 64 CalculatorAlso in IP Addressing & Subnetting
- Loopback Addressing Plan CalculatorAlso in IP Addressing & Subnetting
- Point To Point Link Addressing CalculatorAlso in IP Addressing & Subnetting
