About this interactive
A subnet mask tells a device where the network part of an address ends: a one for every network bit, then a zero for every host bit, 32 bits in all. The default subnet mask draws that line at the class boundary: 255.0.0.0 (/8) for Class A, 255.255.0.0 (/16) for Class B, 255.255.255.0 (/24) for Class C. A custom subnet mask draws it somewhere else, usually further right, after you borrow host bits.
The prefix length, written after a slash in CIDR notation, is just the count of ones: the class default plus the bits borrowed. 140.12.0.0 is Class B, so borrowing 8 bits gives /24, and 210.15.3.0 is Class C, so borrowing 4 gives /28. To write a prefix as a mask, fill whole octets with 255 and put the leftover bits in the next octet, where the ones fill from the left: 1 bit is 128, 2 are 192, then 224, 240, 248, 252, 254 and 255. /13 is 255.248.0.0, /18 is 255.255.192.0 and /28 is 255.255.255.240. To go back, count the ones in each octet and add them up.
Type masks in dotted decimal, prefixes as a number with no slash, and binary as 8 digits with no spaces. Anything you miss shows the answer and how to work it out. Seven of the twenty-one 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 →