What is a Subnet Mask?
If you have ever looked at your computer's network settings, you have likely seen a subnet mask, usually something like 255.255.255.0. But what does it actually do?
A subnet mask works alongside an IP address to divide the IP address into two parts:
- The Network part (identifies the specific network)
- The Host part (identifies the specific device on that network)
Without a subnet mask, your computer wouldn't know if another IP address is on its local network (meaning it can talk to it directly) or on the internet (meaning it has to send the data to the router).
How Subnet Masks Work
Let's look at a standard home network:
- IP Address:
192.168.1.50 - Subnet Mask:
255.255.255.0
The 255 means "this part belongs to the network." The 0 means "this part belongs to the device."
So, applying the mask to the IP:
- Network:
192.168.1 - Device:
50
Your computer now knows that ANY device starting with 192.168.1 is on the same local network. If it wants to talk to 192.168.1.100, it talks directly. If it wants to talk to 8.8.8.8, it knows that doesn't match the network, so it sends the request to the router.
Why Do We Need Subnets?
Imagine if the internet was one giant network without any subdivisions. Every single computer would hear every single broadcast message from every other computer. The network would instantly collapse under the traffic.
Subnetting solves this by creating boundaries.
Benefits of Subnetting:
- Performance: Reduces network congestion by keeping local traffic local.
- Security: You can isolate networks. For example, a business can put the HR department on one subnet and the Guest Wi-Fi on another, and block them from talking to each other.
- Organization: Makes it easier to manage IP addresses.
CIDR Notation (The Slash Format)
Writing out 255.255.255.0 is tedious. Network engineers use CIDR notation (Classless Inter-Domain Routing).
Instead of the full mask, CIDR just counts the number of network bits.
255.0.0.0=/8255.255.0.0=/16255.255.255.0=/24
So, 192.168.1.50 with a subnet mask of 255.255.255.0 is simply written as: 192.168.1.50/24
Common Subnet Sizes
Here are the most common subnets you will encounter:
| CIDR | Subnet Mask | Total IPs | Usable IPs | Common Use |
|---|---|---|---|---|
/8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Massive ISP networks |
/16 | 255.255.0.0 | 65,536 | 65,534 | Large corporate networks |
/24 | 255.255.255.0 | 256 | 254 | Home networks, small offices |
/32 | 255.255.255.255 | 1 | 1 | A single specific computer |
Note: The number of "usable" IPs is always total minus 2. The first IP identifies the network itself, and the last IP is the broadcast address.
Summary
Subnet masks define the boundaries of a network. They tell your computer which IPs are local neighbors and which are distant strangers on the internet.
To see information about public subnets (including the ASN and ISP that owns them), you can use our IP Lookup tool to trace any public IP address.
