What Is Subnetting? Masks, Networks and Host Ranges
Subnetting divides an IP address space into smaller network blocks by defining which address bits identify the network and which bits can vary within each subnet.
How it works
Given an IPv4 address and a subnet mask or prefix, the network portion determines the aligned subnet boundary. The remaining bits identify positions inside that subnet. From that boundary, an administrator can calculate the subnet's network address, broadcast address, total size, and traditional usable-host range.
Network bits and host bits
Every subnet calculation divides the address bits into a fixed network portion and a variable host or address portion. Addresses whose network bits match fall inside the same mathematical subnet, while the remaining bits determine each position from the beginning to the end of that block.
For example, a /26 prefix fixes 26 of an IPv4 address's 32 bits and leaves 6 bits to vary. The prefix notation establishes the boundary; the separate CIDR guide explains slash notation and general block sizing in more depth.
Sharing a calculated subnet does not by itself prove that two devices can communicate directly. VLANs, router interfaces, host masks, firewalls, and physical or virtual network configuration still determine actual connectivity. The calculation describes address boundaries, not observed network behavior.
Subnet masks and prefix lengths
A dotted-decimal subnet mask and a prefix length can express the same IPv4 network boundary. The prefix /26 corresponds to 255.255.255.192: the mask's leading one bits identify the network portion, while its remaining zero bits identify positions that can vary inside the subnet.
Administrators commonly use prefix notation because it is compact, while operating systems and network settings may display a dotted mask. Converting between them does not change the subnet. An address entered with either representation should produce the same aligned network and end boundaries.
A mask needs to be interpreted with the address it applies to. Knowing only that a network uses /26 describes the size and boundary pattern, but not which specific /26 contains a device until the device's address is also known.
Network, broadcast, and usable host addresses
Consider 192.0.2.130/26. The /26 boundaries occur every 64 addresses, so this address falls in the subnet beginning at 192.0.2.128 and ending at 192.0.2.191. The subnet contains 64 total addresses and uses the mask 255.255.255.192.
When all host bits are zero, the result is the network address, 192.0.2.128. When all host bits are one, the result is the traditional IPv4 broadcast address, 192.0.2.191. Traditional subnetting therefore treats 192.0.2.129 through 192.0.2.190 as the usable-host range, containing 62 addresses.
Subtracting two is not a universal rule for every prefix. A /31 is commonly used for point-to-point links where both addresses can be used, and a /32 represents a single host route. Calculator output should account for those cases rather than forcing the traditional network-and-broadcast reservation onto them.
Dividing a network and interpreting calculator results
Increasing the prefix length divides a larger block into smaller equal aligned subnets. For example, 192.0.2.0/24 can be divided into four /26 subnets beginning at 192.0.2.0, 192.0.2.64, 192.0.2.128, and 192.0.2.192. Each contains 64 total addresses with its own network and broadcast boundaries.
The appropriate division depends on the actual network design, including the number of required address positions, routing plan, VLAN structure, and expected growth. A mathematically valid subnet does not confirm that routers, interfaces, DHCP, or access rules have been configured to use it.
A subnet calculator derives boundaries, masks, ranges, and address counts from the supplied address and prefix. It does not scan the range, discover live hosts, test reachability, or observe the router and VLAN configuration on a real network.
Practical guidance
- Calculate the aligned network boundary before assigning addresses or writing a routing rule.
- Use the same prefix or mask consistently on devices that are intended to share a subnet.
- Treat calculator results as address mathematics, then verify routing, VLAN, firewall, and interface configuration separately.
Common question
Why are two addresses often excluded from the usable-host count? Traditional IPv4 subnets reserve the all-zero host value as the network address and the all-one value as the broadcast address. Special prefixes such as /31 and /32 do not follow that simple subtraction rule.