About this interactive
Choosing a subnet mask is choosing how many host bits to borrow, and two needs pull against each other. The number of subnets sets a floor: borrowing b bits gives 2^b subnets, so 20 subnets need at least 5 bits (32). The hosts in each subnet set a ceiling: the bits left on the host side must still give enough usable addresses, 2^h - 2, so on a Class C network 5 usable hosts allow at most 5 borrowed bits (6 usable). Here the floor and the ceiling meet at 5, so you borrow 5.
When the floor is above the ceiling, no line works on that network: 10 subnets of 20 hosts on a Class C needs at least 4 bits for the subnets, but 4 bits leave only 14 usable hosts. When there are several lines between the floor and the ceiling, pick by growth. If the hosts in each subnet will grow, borrow the fewest bits and keep the host side big. If the number of subnets will grow, borrow the most the hosts allow. If you want room for both, take the middle line. On a Class B network the same steps run over 16 host bits instead of 8: 8 subnets of 5,000 hosts borrows exactly 3 bits, since 4 would leave only 4,094.
This set stops at /30. Type the number of bits, or X if no number of bits meets both needs. Anything you miss shows the answer and how to work it out. Seven of the twenty-three questions are drawn each run.
About TechKnowSurge
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →