Connect via MCP →

Enter Calculation

Formula

Show calculation steps (1)
  1. Usable Hosts per Subnet

    Usable Hosts per Subnet: Number of Subnets Calculator

    Host bits = 32 minus New Prefix; usable hosts subtract the network and broadcast addresses

Advertisement

Results

Number of Subnets
16
subnets created
Borrowed bits 4
Total addresses per subnet 16
Usable hosts per subnet 14

What is the Number of Subnets Calculator?

When you take an existing IPv4 network and divide it into smaller networks, you "borrow" bits from the host portion of the address to create a subnet identifier. This calculator tells you exactly how many subnets you create when you change a network's prefix length (CIDR notation, like /24) to a longer one (like /28). It works for any IPv4 prefix from /0 to /32.

How to use it

Enter the original prefix length of your network (for example 24 for a 255.255.255.0 mask) and the new prefix length you want to subnet down to (for example 28). The calculator returns the number of subnets, the number of borrowed bits, the total addresses in each new subnet, and the usable host addresses per subnet.

The formula explained

The number of subnets is simply two raised to the power of the borrowed bits:

\(\text{borrowed bits} = \text{new prefix} - \text{original prefix}\)

$$\text{Subnets} = 2^{\left(\text{New Prefix} - \text{Original Prefix}\right)}$$

Each borrowed bit doubles the number of available subnets. The hosts per subnet come from the remaining host bits: \(2^{(32 - \text{new prefix})}\), minus 2 for the network and broadcast addresses.

$$\text{Usable Hosts} = 2^{\left(32 - \text{New Prefix}\right)} - 2$$
Advertisement
Binary tree doubling showing how each borrowed bit doubles the number of subnets
Each borrowed bit doubles the subnet count: 1, 2, 4, 8 subnets.
Diagram showing an IPv4 prefix split into network bits, borrowed bits, and host bits along a 32-bit bar
Borrowed bits are taken from the host portion to create new subnets.

Worked example

Suppose you have a /24 network and you subnet it to /28. The borrowed bits are \(28 - 24 = 4\). So the number of subnets is \(2^4 = 16\). Each /28 subnet has \(2^{(32-28)} = 2^4 = 16\) total addresses, leaving \(16 - 2 = 14\) usable hosts each.

FAQ

Why subtract 2 from the host count? One address is reserved as the network (subnet) address and one as the broadcast address, so they cannot be assigned to hosts.

What if the new prefix is smaller than the original? That would be supernetting (combining networks), so the number of subnets created is reported as 0 here — this tool counts subdivisions only.

Does a /31 have usable hosts? Under classic rules a /31 yields 0 usable hosts \((2 - 2)\), though RFC 3021 allows point-to-point /31 links to use both addresses.

Last updated: