If you’re learning about networking or trying to pass a certification like CompTIA or Cisco, understanding subnet masks is a must. They can seem confusing at first, but once you break it down, it starts to make a lot more sense.
This guide is your go-to subnet mask cheat sheet with simple explanations and a quick reference table to help you understand how IP addresses and subnets work together.
Subnet Mask Cheat Sheet
What Is a Subnet Mask?
A subnet mask is a 32-bit number that works with an IP address to divide a network into smaller parts called subnets. It tells your computer which part of the IP address refers to the network and which part refers to the host (a device like a PC, printer, or router).
For example:
- IP address:
192.168.1.10 - Subnet mask:
255.255.255.0
That means the first three parts (192.168.1) are for the network, and the last part (.10) is the host.
Why Subnetting Matters
Subnetting helps you:
- Improve network performance
- Organize large networks
- Control traffic
- Increase security
- Avoid wasting IP addresses
It’s used everywhere in networking, from home Wi-Fi routers to huge enterprise systems.
Subnet Mask Basics
Here’s what you should know:
- A Class A network starts with
1–126and has a default mask of255.0.0.0 - A Class B network starts with
128–191and has a default mask of255.255.0.0 - A Class C network starts with
192–223and has a default mask of255.255.255.0
Now let’s look at a full cheat sheet.
Subnet Mask Cheat Sheet
| CIDR | Subnet Mask | # of Hosts | # of Subnets | Host IP Range |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 1 | 1.0.0.1 – 126.255.255.254 |
| /16 | 255.255.0.0 | 65,534 | 256 | 1.0.0.1 – 1.0.255.254 |
| /24 | 255.255.255.0 | 254 | 65,536 | 192.168.1.1 – 192.168.1.254 |
| /25 | 255.255.255.128 | 126 | 131,072 | 192.168.1.1 – 192.168.1.126 |
| /26 | 255.255.255.192 | 62 | 262,144 | 192.168.1.1 – 192.168.1.62 |
| /27 | 255.255.255.224 | 30 | 524,288 | 192.168.1.1 – 192.168.1.30 |
| /28 | 255.255.255.240 | 14 | 1,048,576 | 192.168.1.1 – 192.168.1.14 |
| /29 | 255.255.255.248 | 6 | 2,097,152 | 192.168.1.1 – 192.168.1.6 |
| /30 | 255.255.255.252 | 2 | 4,194,304 | 192.168.1.1 – 192.168.1.2 |
Note: The number of hosts = total usable IP addresses (excluding network and broadcast addresses)
What Does CIDR Mean?
CIDR stands for Classless Inter-Domain Routing. Instead of writing a subnet mask like 255.255.255.0, you can write it as /24. The number after the slash is the number of bits used for the network portion.
So:
/24means 24 bits for the network and 8 bits for the host/26means 26 bits for the network and 6 bits for the host
The smaller the host bits, the fewer devices can fit in that subnet.
How to Choose the Right Subnet
Here’s a quick way to figure out what subnet you need:
- For 2 devices → use /30
- For 14 devices → use /28
- For 50 devices → use /26
- For 200 devices → use /24
- For 500+ devices → go with /23 or bigger
Always leave some room for growth. If your office has 45 computers now, pick a subnet that supports at least 60.
Tools That Help
If math isn’t your thing (same), use online tools like:
- Subnet calculators
- IP address planners
- CIDR chart generators
They help avoid mistakes and make subnetting way faster.
Final Thoughts
Subnet masks might seem scary at first, but once you understand the pattern, it becomes easier to plan networks and troubleshoot issues. Use this cheat sheet whenever you’re working with IPs, routers, or trying to pass a networking exam.
Want a printable version of this subnet mask cheat sheet? Just ask and I can make one for you.







