Subnet Count Calculator

Count subnets within a CIDR block.

Result

256
256

How it is calculated

For an IPv4 block written in CIDR notation, the prefix length is the number of fixed network bits out of 32. Splitting a parent /n into children /m gives subnets = 2m − n. Each child has 232 − m addresses, which is the figure shown as hosts each.

The prefix values are rounded to whole numbers. The child prefix must be at least as long as the parent and no larger than 32, and the parent cannot be negative; otherwise no result is shown. The hosts figure counts all addresses in the child block. In ordinary IPv4 subnets the network and broadcast addresses are not assignable, so usable hosts are 2 fewer (for /31 and /32 special rules apply).

Worked example

Parent /16, children /24. Subnets = 224 − 16 = 28 = 256. Addresses per child = 232 − 24 = 28 = 256. The tool shows 256 subnets with 256 addresses each, which means 254 usable host addresses per /24.

Try this example →

Common mistakes

  • Treating the shown host figure as usable hosts; subtract 2 for the network and broadcast addresses in regular subnets.
  • Swapping the fields: a longer prefix means a smaller block, so the child must have the larger number.
  • Entering a netmask such as 255.255.255.0 instead of the prefix length 24.
  • Assuming subnets must be equal in a real design; this tool only counts equal-size splits.

Sources

About this calculator

In CIDR notation, a network's prefix length (like /24) determines its size; splitting a block with parent prefix p into smaller subnets with child prefix c yields 2^(c − p) subnets, and each of those subnets has 2^(32 − c) total addresses, of which 2^(32 − c) − 2 are usable for hosts (the first address is the network address, the last is the broadcast address). This calculator applies both formulas to show how many subnets a given split creates and how many hosts each one can hold.

Network engineers and system administrators use this daily when subnetting an IP range for a new office, VLAN, or department, cloud infrastructure engineers use it when carving VPCs and subnets in AWS, Azure, or GCP, and students studying for networking certifications like the CCNA use it to practice and check subnetting problems by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The second figure counts every address in each child block, including the network and broadcast addresses, so for ordinary host subnets such as a /24 subtract 2 to get usable hosts. The special cases /31 and /32 follow different rules. This works for IPv4 only, and the child prefix cannot be shorter than the parent. Planning a VLAN layout from one block? Tell us whether you would find IPv6 prefixes useful here.

Popular calculators

All Calculators