TechKnowSurge
CompTIA Network+ 1.7 Cisco CCNA 1.6 Cisco CCST Networking 2.2
InteractiveNetworkFree

Subnet Mask Notation Calculator

Type default and custom subnet masks: from a class, from bits borrowed, from a prefix, from binary, and back.

⚑ Complete this interactive to capture a CTF flag worth 5 points.

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.

What you'll learn

Aligned to

CompTIA Network+
1.7 Given a scenario, use appropriate IPv4 network addressing.
Cisco CCNA
1.6 Configure and verify IPv4 addressing and subnetting
Cisco CCST Networking
2.2 Identify IPv4 addresses and subnet formats

Key terms

Subnet Mask
A 32-bit number that divides an IP address into network and host portions.
Default Subnet Mask
A subnet mask that draws the network/host boundary at the classful boundary of an IP address class, such as 255.0.0.0 for a Class A address.
Custom Subnet Mask
A subnet mask that draws the network/host boundary at a point other than the classful boundary, allowing flexible division of network and host bits.
Prefix Length
The number of consecutive 1-bits in a subnet mask, written after a slash (e.g., /24), that defines how many bits of an IP address represent the network portion versus the host portion. A /24 prefix means the first 24 bits identify the network, leaving 8 bits for host addresses.
Classless Inter-Domain Routing
CIDR
A method for allocating IP addresses and expressing routing prefixes that replaces the older classful addressing scheme by using variable-length prefix notation (e.g., /24). CIDR enables more efficient use of IPv4 address space and reduces the size of internet routing tables through route aggregation.
Bit Borrowing
The practice of taking bits from the host portion of a classful default subnet mask to create additional network subdivisions, extending the prefix length.
Octet
One of the four 8-bit sections of an IPv4 address, each separated by a dot in dotted decimal notation and representing a decimal value from 0 to 255. For example, in 192.168.1.1, the four octets are 192, 168, 1, and 1.

Topics

Subnet Mask Default Subnet Mask Custom Subnet Mask Cidr Notation Interactive Calculation

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 →