Subnet Mask Cheat Sheet: Common Masks, CIDR, Host Ranges
A subnet mask cheat sheet helps you match a dotted-decimal mask like `255.255.255.0` with a CIDR prefix like `/24` and pick the right size for the network you’re setting up. `255.255.255.0` and `/24` are the same subnet mask written two ways. Use this cheat sheet to spot the common masks fast, check the usable host count, and avoid typing the wrong value into a router, switch, or DHCP scope.
Subnet mask to CIDR at a glance
A subnet mask and a CIDR prefix describe the same setting in two formats. The mask uses dotted decimal, while CIDR shows how many network bits appear after the slash.
Here’s the quick read for the masks you’ll see most often:
255.0.0.0=/8255.255.0.0=/16255.255.255.0=/24255.255.255.128=/25255.255.255.192=/26255.255.255.224=/27255.255.255.240=/28255.255.255.248=/29255.255.255.252=/30
Use the bigger slash number as a clue that the subnet is smaller. /24 is a common small LAN. /30 is common for point-to-point links. If you see 255.255.255.0 next to /24, those are not different settings; they mean the same thing.
The most common subnet masks in one table
These are the masks most people reach for in small networks and lab setups. The list was chosen because these are the sizes you’re most likely to compare when you’re setting up a home LAN, office VLAN, management subnet, or point-to-point link. The usable host count excludes the network address and broadcast address, so the total addresses is always two more than the usable count.
| Subnet mask | CIDR | Usable hosts | Total addresses |
|---|---|---|---|
| 255.255.255.0 | /24 | 254 | 256 |
| 255.255.255.128 | /25 | 126 | 128 |
| 255.255.255.192 | /26 | 62 | 64 |
| 255.255.255.224 | /27 | 30 | 32 |
| 255.255.255.240 | /28 | 14 | 16 |
| 255.255.255.248 | /29 | 6 | 8 |
| 255.255.255.252 | /30 | 2 | 4 |
| 255.255.0.0 | /16 | 65,534 | 65,536 |
| 255.0.0.0 | /8 | 16,777,214 | 16,777,216 |
For day-to-day work, /24, /25, /26, /27, /28, /29, and /30 are the ones you’ll see most often. /16 and /8 show up in larger private networks or broader addressing plans. If you need to work fast, start with the host count you need, then match it to the mask.
Which mask you should pick for a small network
Pick the smallest subnet that still leaves room for the devices you expect, plus a little growth. That keeps address use tidy and makes troubleshooting easier.
For a 50-device office VLAN, 255.255.255.192 or /26 is the usual fit. It gives 62 usable hosts, so you have some headroom without wasting a whole /24.
For a 14-host lab, 255.255.255.240 or /28 fits exactly. It gives 14 usable addresses, which is a neat match if you know the lab size won’t change.
For a point-to-point link, 255.255.255.252 or /30 is the common choice. It gives 2 usable hosts, which fits one address on each end.
A home LAN often uses /24 because it is simple and leaves plenty of room for phones, laptops, printers, and smart devices. If you’re unsure, check the device count first, then choose the next subnet size up. That is usually safer than trying to squeeze into a subnet that is already full.
How to choose
Use the mask that fits the device count without leaving a lot of wasted space. A home LAN usually lands on /24. An office VLAN often fits in /26 or /27 if the group is small. A lab or management subnet can fit in /28 if the host count stays low. A point-to-point link usually wants /30.
If you’re deciding between two sizes, pick the one that leaves a little room to grow. If the subnet is meant for a fixed-purpose link, like router to router, match it tightly. If it will hold user devices, give yourself some extra space.
How many hosts each mask gives you
The usable-host formula is 2^(host bits) - 2. The - 2 is there because one address is reserved for the network itself and one for broadcast.
If you have a /24, that leaves 8 host bits because IPv4 addresses have 32 bits total. So the math is 2^8 - 2 = 254 usable hosts.
A quick way to sanity-check a subnet size is to count the host bits from the prefix:
/24leaves 8 host bits, so 254 usable hosts/26leaves 6 host bits, so 62 usable hosts/28leaves 4 host bits, so 14 usable hosts/30leaves 2 host bits, so 2 usable hosts
You do not need to do the full binary math every time. If you memorize the common table above, the formula is mainly there to confirm a choice or catch a typo. If a subnet is supposed to hold 20 devices, a /28 will not work. It only has 14 usable addresses, so you would need something larger, such as a /27.
What trips people up with subnet masks
The most common mistake is mixing up the network address with a usable host address. In 192.168.1.0/24, 192.168.1.0 is the network ID, not a device address. The first usable host is 192.168.1.1.
Another easy mistake is treating 255.255.255.0 and /24 as different choices. They are the same setting in different notation. If one screen asks for a mask and another asks for prefix length, convert instead of guessing.
People also assume every subnet has the same host count. It does not. 255.255.255.240 gives 14 usable addresses, while 255.255.255.252 gives only 2. That difference matters when you are setting up DHCP scopes, router interfaces, or VLANs.
The fastest way to avoid mistakes is to check three things before saving: the prefix, the usable host count, and the network address. If those three agree, you are probably fine. If they do not, stop and recalculate before you apply the config.
Quick examples you can copy into real configs
These examples show how the address and mask usually appear together. They are useful when you are checking a router interface, a switch SVI, or a DHCP scope.
192.168.1.0/24— common home or small office LAN192.168.1.0 255.255.255.0— same subnet, different notation192.168.10.0/26— useful for a small office VLAN with room for 62 hosts10.0.0.0/16— large private network block with 65,534 usable hosts172.16.5.0/28— small lab or management subnet with 14 usable hosts192.168.100.0/30— point-to-point link with 2 usable hosts
If you’re typing a config by hand, read the address and mask as a pair, not as separate facts. A correct host address in the wrong subnet can still break routing, DHCP, or gateway settings. When something looks off, compare the prefix length, the mask, and the expected host count together.
Conclusion
If you only remember one part of this cheat sheet, make it the common pairs: `/24` for 254 usable hosts, `/26` for 62, `/28` for 14, and `/30` for 2. That covers most small network work. Before you save a router, switch, or DHCP setting, check that the mask matches the device count and that you are using the network address, not a host address. If you do that, most subnet mistakes disappear before they reach production.
Frequently Asked Questions
Is `255.255.255.0` the same as `/24`?
Yes. They are two ways to write the same subnet mask. The dotted-decimal version shows the mask as four octets, and the CIDR version shows how many network bits are set.
Why does a subnet have two fewer usable addresses than total addresses?
One address is reserved for the network itself and one for broadcast. That is why a `/24` has 256 total addresses but only 254 usable hosts.
What mask should I use for a point-to-point link?
`255.255.255.252` or `/30` is the common choice because it gives 2 usable host addresses, which fits one address on each end of the link.
Can I use `/24` for everything small?
You can, but it is often larger than you need. A `/24` is simple, but smaller subnets such as `/26` or `/28` can fit the device count better and keep address space tidy.