An IP subnet mask cheat sheet is a quick reference guide that helps you understand how IP addresses are divided into networks and hosts. It shows the relationship between CIDR notation (like /24), subnet masks (like 255.255.255.0), and the number of usable IP addresses in each subnet. Whether you’re configuring routers, managing VPS servers, or studying for networking certifications, a subnet mask cheat sheet saves time and reduces calculation errors.
What Is an IP Address?
Every device on a network is given a unique identifier called an IP (Internet Protocol) address. In IPv4, the address is 32 bits long and typically written in dotted decimal format:
Code 192.168.1.10
Each IPv4 address has two parts:
- Network portion – Identifies the network.
- Host portion – Identifies the device within that network.
Which portion of the IP address pertains to the network and which to the host is determined by the subnet mask.
What Is a Subnet Mask?
A subnet mask is also a 32-bit number that separates the network portion from the host portion of an IP address. For example:
Copy code IP Address: 192.168.1.10 Subnet Mask: 255.255.255.0
The subnet mask tells us that the first 24 bits represent the network, and the remaining 8 bits represent hosts.
CIDR Notation Explained
Instead of writing the full subnet mask, we commonly use CIDR (Classless Inter-Domain Routing) notation:
Copy code 192.168.1.0/24
The /24 means 24 bits are used for the network portion.
IP Subnet Mask Cheat Sheet (Quick Reference Table)
Here is a simplified IPv4 subnet cheat sheet:
| CIDR | Subnet Mask | Total IPs | Usable Hosts |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /27 | 255.255.255.224 | 32 | 30 |
| /26 | 255.255.255.192 | 64 | 62 |
| /25 | 255.255.255.128 | 128 | 126 |
| /24 | 255.255.255.0 | 256 | 254 |
| /23 | 255.255.254.0 | 512 | 510 |
| /22 | 255.255.252.0 | 1024 | 1022 |
| /21 | 255.255.248.0 | 2048 | 2046 |
| /20 | 255.255.240.0 | 4096 | 4094 |
| /19 | 255.255.224.0 | 8192 | 8190 |
| /18 | 255.255.192.0 | 16384 | 16382 |
| /17 | 255.255.128.0 | 32768 | 32766 |
| /16 | 255.255.0.0 | 65536 | 65534 |
How to Calculate Usable IP Addresses
Every subnet has:
- 1 Network Address
- 1 Broadcast Address
- Remaining addresses are usable hosts
A subnet’s total IP address count is established by:
TotalIPs=2(32−CIDR)
To calculate usable hosts:
UsableHosts=2(32−CIDR)−2
For example, with /24:
- 32 – 24 = 8
- 2⁸ = 256 total IPs
- 256 – 2 = 254 usable hosts
Binary Breakdown of a Subnet Mask
Understanding subnetting becomes easier if you think in binary.
Example:
Code 255.255.255.0
In binary:
Code 11111111.11111111.11111111.00000000
Each 1 represents a network bit.
Each 0 represents a host bit.
A /26 subnet mask:
Code 255.255.255.192
Binary:
Code 11111111.11111111.11111111.11000000
This means 26 network bits and 6 host bits.
Common Subnet Use Cases
/30 Subnet (Point-to-Point Links)
- Used for router-to-router connections
- Only 2 usable IPs
- Efficient for WAN links
/29 Subnet (Small Office Setup)
- 6 usable IPs
- Good for small server environments
/24 Subnet (Most Common LAN)
- 254 usable IPs
- Default choice for small to medium office networks
/16 Subnet (Large Enterprise Network)
- 65,534 usable IPs
- Used in universities and enterprise environments
Classful vs Classless Networking
Historically, IPv4 addresses were divided into classes:
- Class A: /8
- Class B: /16
- Class C: /24
Modern networks use CIDR, which removes strict class boundaries and allows flexible subnetting. This improves IP address utilization and reduces waste.
Private IP Address Ranges
Private networks are only allowed to use the following IP ranges:
| Range | CIDR |
|---|---|
| 10.0.0.0 – 10.255.255.255 | /8 |
| 172.16.0.0 – 172.31.255.255 | /12 |
| 192.168.0.0 – 192.168.255.255 | /16 |
On the open internet, these addresses cannot be routed.
Subnetting Tips for Quick Calculation
Here are practical shortcuts professionals use:
1. Memorize the “Magic Numbers”
Last octet subnet increments:
- /24 → 256
- /25 → 128
- /26 → 64
- /27 → 32
- /28 → 16
- /29 → 8
- /30 → 4
2. Count Host Bits
If you know the CIDR, subtract from 32 to get host bits.
3. Remember Powers of 2
- 2⁰ = 1
- 2¹ = 2
- 2² = 4
- 2³ = 8
- 2⁴ = 16
- 2⁵ = 32
- 2⁶ = 64
- 2⁷ = 128
- 2⁸ = 256
Real-World Example
Suppose your hosting provider gives you:
Code IP Block: 203.0.113.0/29
Using the cheat sheet:
- Total IPs: 8
- Usable IPs: 6
- 1 network address
- 1 broadcast address
This means you can assign 6 public IPs to servers, firewalls, or virtual machines.
Why Subnetting Is Important
Subnetting:
- Improves network performance
- Reduces broadcast traffic
- Enhances security segmentation
- Optimizes IP usage
- Simplifies routing
For system administrators, DevOps engineers, and hosting providers, understanding subnet masks is essential when configuring firewalls, VPS servers, load balancers, or email servers.
IPv4 vs IPv6 (Quick Note)
While IPv4 uses 32 bits, IPv6 uses 128 bits. Subnetting principles are similar, but IPv6 uses hexadecimal notation and much larger address spaces.
Example IPv6 subnet:
Code 2001:db8::/64
Most IPv6 networks use /64 as a standard subnet size.
Final IP Subnet Mask Cheat Sheet Summary
Here’s what you should remember:
- CIDR notation tells you how many bits are for the network.
- Subnet mask is the dotted decimal representation.
- Total IPs = 2^(32 – CIDR)
- Usable IPs = Total IPs – 2
- /24 is the most common subnet for LANs.
- Smaller CIDR = more hosts.
- Larger CIDR = fewer hosts.
If you’re managing hosting servers, configuring routers, or preparing for networking certifications like CCNA, keeping this IP Subnet Mask Cheat Sheet handy will save you time and prevent costly misconfigurations.
Mastering subnetting may seem complex at first, but once you understand the binary logic and memorize key CIDR values, it becomes second nature.
