
Subnetting is arguably the most fundamental and intimidating skill for any aspiring or professional network engineer. As of late 2025, the principles of IPv4 addressing remain the bedrock of network infrastructure, making a current and accurate Subnet Mask Cheat Sheet an indispensable tool for certification exams (like CCNA) and real-world network design. This guide cuts through the complexity, providing you with a definitive, up-to-date reference table and the "Magic Number" calculation trick to master subnetting instantly.
The transition to IPv6 is ongoing, but the vast majority of internal networks and legacy systems still rely on IPv4. Understanding how to efficiently divide a large network into smaller, manageable subnets—a process known as subnetting—is crucial for reducing network congestion, improving security, and conserving precious IP addresses. This comprehensive cheat sheet and guide will elevate your expertise from a basic user to a subnetting master.
The Definitive Subnet Mask and CIDR Conversion Table (2025 Update)
This table is the core of your subnetting knowledge. It maps the CIDR Notation (Classless Inter-Domain Routing), the standard Subnet Mask in dotted-decimal format, the total number of IP Addresses in the block, and the number of Usable Hosts (total addresses minus the network and broadcast addresses).
The table focuses on the most commonly subnetted octet (the fourth octet for a Class C network, or the last octet of the network portion for other classes), but the principles apply across all 32 bits of an IPv4 address.
| CIDR Prefix | Subnet Mask (Dotted Decimal) | Binary Mask Bits (Trailing Octet) | Total IP Addresses (Block Size) | Usable Hosts (2^n - 2) |
|---|---|---|---|---|
| /30 | 255.255.255.252 | 11111100 | 4 | 2 |
| /29 | 255.255.255.248 | 11111000 | 8 | 6 |
| /28 | 255.255.255.240 | 11110000 | 16 | 14 |
| /27 | 255.255.255.224 | 11100000 | 32 | 30 |
| /26 | 255.255.255.192 | 11000000 | 64 | 62 |
| /25 | 255.255.255.128 | 10000000 | 128 | 126 |
| /24 | 255.255.255.0 | 00000000 | 256 | 254 |
| /23 | 255.255.254.0 | N/A (3rd Octet: 11111110) | 512 | 510 |
| /22 | 255.255.252.0 | N/A (3rd Octet: 11111100) | 1,024 | 1,022 |
| /16 | 255.255.0.0 | N/A (2nd Octet: 11111111) | 65,536 | 65,534 |
| /8 | 255.0.0.0 | N/A (1st Octet: 11111111) | 16,777,216 | 16,777,214 |
The Essential Subnetting Calculation Trick: The Magic Number
Forget complex binary conversions for a moment. The "Magic Number" method is a simple, quick-fire trick that every network professional uses to calculate subnet boundaries and valid host ranges in their head.
How the Magic Number Works
The Magic Number is the key to determining the size of each subnet block. It is calculated by subtracting the final non-255 octet of the subnet mask from 256.
Formula: Magic Number = 256 - Last Subnet Mask Octet
This number represents the block size or the increment by which the network addresses will increase.
Example: Subnet Mask 255.255.255.224 (/27)
- Find the Last Octet: The last non-255 octet is 224.
- Calculate the Magic Number:
256 - 224 = 32. - Determine Subnet Addresses: The subnets will increment by 32 in the fourth octet.
- Subnet 1:
.0(Network Address) - Subnet 2:
.32(Network Address) - Subnet 3:
.64(Network Address) - ...and so on, up to
.224.
- Subnet 1:
- Determine Host and Broadcast Addresses:
- For the
.32subnet, the Network Address is.32. - The Broadcast Address is the number immediately before the next subnet's network address (
.64 - 1 = .63). - The Usable Host Range is the range between the Network and Broadcast addresses (
.33to.62).
- For the
This method simplifies the process of finding the Network Address, the Broadcast Address, and the range of usable Host Addresses for any given subnet mask.
Advanced Subnetting Concepts: VLSM and Private Ranges
To truly achieve topical authority and perform advanced network design, you must understand the concepts of Variable Length Subnet Masking (VLSM) and the reserved Private IP Address Ranges designated by the Internet Assigned Numbers Authority (IANA).
1. VLSM vs. FLSM: The Modern Standard
In the early days of networking, Fixed Length Subnet Mask (FLSM) was common. With FLSM, every subnet within a network used the exact same subnet mask, often leading to a massive waste of IP addresses.
Variable Length Subnet Mask (VLSM) is the modern, more efficient standard. VLSM allows you to use different subnet masks for different subnets within the same overall network.
- Benefit: You can create a small subnet (e.g., /30 with 2 usable hosts) for a point-to-point link between two routers, and a much larger subnet (e.g., /24 with 254 usable hosts) for a large user LAN. This conservation of addresses is critical.
- Requirement: Routing protocols like OSPF, EIGRP, and BGP support VLSM, whereas older protocols like RIPv1 do not.
2. IANA Private IP Address Ranges
The following ranges are reserved by IANA for use on private networks and are not routable on the public internet.
When you configure a corporate or home network, you should always use addresses from these ranges.
- Class A Private Range:
10.0.0.0to10.255.255.255(A single /8 network) - Class B Private Range:
172.16.0.0to172.31.255.255(16 contiguous /12 networks) - Class C Private Range:
192.168.0.0to192.168.255.255(256 contiguous /16 networks)
The most common range used in home and small office networks is the Class C range, specifically the 192.168.1.0/24 or 192.168.0.0/24 block.
Key Entities and LSI Keywords for Subnetting Mastery
A deep understanding of subnetting involves mastering the terminology and the underlying mathematical principles. Incorporating these entities into your knowledge base will solidify your status as a Network Engineer.
The Core Subnetting Entities
- IP Address: A unique numerical label assigned to every device in a computer network.
- Subnet Mask: A 32-bit number that separates the IP address into the Network Address and the Host Address portions.
- CIDR Notation: A compact way to write the subnet mask, represented by a slash followed by the number of bits in the network portion (e.g., /24).
- Network Address: The first address in a subnet, where all host bits are '0'. This address is used to identify the subnet itself.
- Host Address: The addresses within the subnet range that can be assigned to devices (computers, servers, printers).
- Broadcast Address: The last address in a subnet, where all host bits are '1'. Data sent to this address is delivered to all devices on that subnet.
- Octet: One of the four 8-bit sections of an IPv4 address or subnet mask.
- Binary: The base-2 number system (using only 0s and 1s) that computers use to represent the 32-bit IP address and subnet mask.
The Powers of 2: The Mathematical Foundation
All subnet calculations are based on the power of 2 (2^n).
- Calculating Hosts: The number of total addresses in a block is
2^h, where 'h' is the number of host bits (the number of '0's in the subnet mask). The number of usable hosts is2^h - 2. - Calculating Subnets: The number of subnets created is
2^s, where 's' is the number of subnet bits (the number of '1's borrowed from the host portion).
By mastering the CIDR table, the Magic Number trick, and the underlying powers of 2, you have all the tools necessary to perform fast, accurate subnetting for any network design challenge in the current IT landscape. This cheat sheet should be your constant companion, whether you're studying for a certification or deploying a complex enterprise network.