What Is a Subnet Mask? CIDR and IPv4 Subnetting Basics
Understand how subnet masks and CIDR prefixes define network boundaries, and how to read network, broadcast, and usable host values.
What a subnet mask is1
A subnet mask defines which bits of a 32-bit IPv4 address belong to the network and which bits belong to the host. For example, 255.255.255.0 means the first 24 bits are the network and the remaining 8 bits are the host portion.
Once you know that boundary, you can calculate the network address, the broadcast address, and the usable host range. That is why subnet masks sit at the center of IPv4 addressing work.
How to read CIDR such as /24 and /262
CIDR is the short way to express the same boundary. /24 means the network portion is 24 bits long, which is equivalent to 255.255.255.0.
Common examples include:
/24: 256 total addresses, typically 254 usable hosts/26: 64 total addresses, typically 62 usable hosts/27: 32 total addresses, typically 30 usable hosts/30: 4 total addresses, typically 2 usable hosts
As the prefix gets longer, the subnet gets smaller and the number of hosts per subnet decreases.
How to read the calculator results3
Network address1
This is the first address of the subnet. It identifies the subnet itself and is not typically assigned to a host.
Broadcast address2
This is the last address of the subnet. In a normal IPv4 subnet, it is reserved and not assigned to a host. For example, 192.168.0.255 is the broadcast address of 192.168.0.0/24, but in 192.168.0.0/18 the last address is 192.168.63.255, so 192.168.0.255 becomes usable inside that larger subnet.
Usable hosts3
This is usually the total address count minus the first and last addresses. /31 and /32 are common operational exceptions.
Practical cases4
- Splitting an existing
/24into multiple VLANs - Checking which network a given host IP belongs to
- Reviewing a plan for CIDR overlaps or gaps
- Choosing between
/30and/31on point-to-point links
In these cases, it helps to check not only the basic subnet calculation but also whether a larger range can be subdivided cleanly and whether multiple CIDRs still line up as expected.
Back to the calculator5
If you want to test a real IP address or CIDR now, go back to the Subnet Mask Calculator. It shows the network, broadcast, usable hosts, and subdivision results immediately.