Subnet Mask
A 32-bit value that tells a device which portion of an IPv4 address identifies the network and which portion identifies the host.
Last updated:
What is a subnet mask?
A subnet mask is a 32-bit value paired with an IPv4 address to divide the address into a network portion and a host portion. The mask is a run of 1-bits followed by a run of 0-bits. When a device wants to send a packet, it applies a bitwise AND between the destination IP and the mask to determine whether the destination is on the same local network (same network portion) or needs to be routed through a gateway.
The most common home-network mask is 255.255.255.0, which means: the first 24 bits are the network, the last 8 bits are the host, and up to 254 devices can share this subnet (256 addresses minus 1 for the network address and 1 for the broadcast address).
Common subnet masks
| Mask | Prefix | Usable Hosts | |-------------------|--------|-------------:| | 255.0.0.0 | /8 | 16,777,214 | | 255.255.0.0 | /16 | 65,534 | | 255.255.255.0 | /24 | 254 | | 255.255.255.128 | /25 | 126 | | 255.255.255.192 | /26 | 62 | | 255.255.255.252 | /30 | 2 |
Subnet masks vs. CIDR notation
CIDR notation is a shorthand for the same information. 192.168.1.0/24 is equivalent to 192.168.1.0 with mask 255.255.255.0. CIDR replaced subnet masks in most modern documentation because it's more compact, but network equipment, operating systems, and older documentation still use the dotted-decimal mask form.
Why subnetting matters
Subnetting lets network administrators split a large block into smaller, independently routed segments — for example, separating a guest Wi-Fi network from a corporate LAN, or isolating servers, printers, and IoT devices. Smaller subnets also shrink broadcast domains, which improves performance on Ethernet-like links.
Our subnet calculator converts between masks, CIDR prefixes, and host counts.