If you've tried to set up a home network or configure a router, you've probably seen something like 255.255.255.0 or /24. That's the subnet mask — and it's easier to understand than it looks.
Think of an IP address like a mailing address:
The subnet mask is your rulebook that tells you which part is the street name and which part is the house number. It does this by using special numbers: 255 means "this section belongs to the network" and 0 means "this section identifies the specific device."
A subnet mask is made of four numbers, each ranging from 0 to 255 (that's because each number represents 8 bits — binary digits — of a 32-bit address). Here are the most common ones you'll see:
IP Address: 192.168.1.100 Subnet Mask: 255.255.255.0 The first three octets (192.168.1) are the NETWORK. The last octet (.100) is the HOST device.
This gives you 254 usable devices on your network (192.168.1.1 through 192.168.1.254). Perfect for a typical home or small office.
IP Address: 172.16.50.200 Subnet Mask: 255.255.0.0 The first two octets (172.16) are the NETWORK. The last two octets (50.200) are the HOST.
That's over 65,000 possible devices! This is common in large organizations or cloud networks.
IP Address: 10.0.0.1 Subnet Mask: 255.255.255.252 This leaves just 2 IP addresses — typically used for point-to-point links between routers.
You might see subnet masks written as /24, /16, or /8 instead of the full four numbers. This is called CIDR notation (Classless Inter-Domain Routing), and it's simply the count of 1-bits in the mask when written in binary:
/8 = 255.0.0.0 (8 network bits) /16 = 255.255.0.0 (16 network bits) /24 = 255.255.255.0 (24 network bits) /25 = 255.255.255.128 (25 network bits) /26 = 255.255.255.192 (26 network bits) /27 = 255.255.255.224 (27 network bits)
The higher the number after the slash, the smaller your subnet. Simple, right?
When your computer wants to send data to another device, it uses the subnet mask to decide:
This is why misconfigured subnet masks cause connectivity issues — your computer thinks a device is nearby when it's actually far away, or vice versa.
| CIDR | Mask | Usable Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /30 | 255.255.255.252 | 2 |
Want to instantly see what any IP address and subnet mask produce? Use our subnet calculator to automatically calculate network addresses, broadcast addresses, and usable host ranges.
Understanding subnet masks is foundational to networking. Once you know how the mask divides an IP address into network and host parts, you're equipped to design, troubleshoot, and optimize networks of any size.