A subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. Written in dotted-decimal (like 255.255.255.0) or CIDR slash notation (like /24), it tells routers and devices which part of an IP address identifies the local network and which part identifies the specific device.
How the Subnet Mask Works
A 255 in the subnet mask means "this octet is part of the network address" (all 8 bits are 1). A 0 means "this octet is the host part" (all 8 bits are 0). Your device performs a bitwise AND between its IP and the subnet mask to find the network address.
Example: IP 192.168.1.42, mask 255.255.255.0
- Network address: 192.168.1.0
- Host: .42
- Any IP ending in .1 to .254 is on the same local network
Common Subnet Masks
| Subnet Mask | CIDR | Hosts Per Subnet |
|---|---|---|
| 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.240 | /28 | 14 |
| 255.255.255.252 | /30 | 2 |
What Your Wi-Fi's Subnet Mask Means
Most home routers use 255.255.255.0 (/24). This means up to 254 devices can connect to your home network. The router (usually at .1) and your devices all share the same network prefix (192.168.1.x).
People Also Ask
- What is a subnet mask and why is it used?
- It defines the boundary between the network and host portions of an IP address. Routers use it to determine whether to route traffic locally or to the internet gateway.
- Is 255.255.0.0 a subnet mask?
- Yes. 255.255.0.0 is a valid subnet mask (CIDR /16). It means the first two octets are the network address and the last two identify hosts, giving 65,534 possible host addresses per network.
Related: Subnets | CIDR | Subnet Calculator