Subnet Cheat Sheet: CIDR, Subnet Masks & IP Ranges
· 12 min read
Understanding IP subnetting is fundamental for network engineers, system administrators, and anyone working with network infrastructure. This comprehensive subnet cheat sheet provides quick reference tables for CIDR notation, subnet masks, IP address ranges, and usable host calculations—everything you need to design, troubleshoot, and optimize your networks.
Whether you're configuring a home router, designing an enterprise network, or studying for your CCNA certification, bookmark this page for instant access to subnet calculations and best practices.
📑 Table of Contents
- Understanding Subnetting Basics
- Complete IPv4 Subnet Reference Table
- Calculating Usable Hosts Per Subnet
- IPv4 Address Classes (Legacy)
- Private IP Address Ranges
- Special-Use IP Addresses
- Practical Subnetting Examples
- Variable Length Subnet Masking (VLSM)
- Supernetting and Route Aggregation
- Common Subnetting Mistakes to Avoid
- Frequently Asked Questions
- Related Articles
Understanding Subnetting Basics
Subnetting is the practice of dividing a network into smaller, more manageable sub-networks. This technique improves network performance, enhances security, and makes IP address allocation more efficient.
Every IPv4 address consists of 32 bits, divided into a network portion and a host portion. The subnet mask determines where this division occurs. For example, in the address 192.168.1.100 with mask 255.255.255.0, the first three octets identify the network, while the last octet identifies the host.
CIDR (Classless Inter-Domain Routing) notation provides a compact way to represent subnet masks. Instead of writing 255.255.255.0, you can write /24, indicating that 24 bits are used for the network portion.
Pro tip: Use our Subnet Calculator to instantly calculate network addresses, broadcast addresses, and usable host ranges for any CIDR notation or subnet mask.
Complete IPv4 Subnet Reference Table
This comprehensive table shows all standard subnet sizes from /32 (single host) to /8 (Class A network). Use this as your go-to reference for quick lookups during network design and troubleshooting.
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Common Use Case |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 | Single host route, loopback |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point links (RFC 3021) |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point links, router connections |
| /29 | 255.255.255.248 | 8 | 6 | Small office, few devices |
| /28 | 255.255.255.240 | 16 | 14 | Small LAN, single department |
| /27 | 255.255.255.224 | 32 | 30 | Department network |
| /26 | 255.255.255.192 | 64 | 62 | Medium LAN, multiple departments |
| /25 | 255.255.255.128 | 128 | 126 | Large LAN, floor of building |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN, most common size |
| /23 | 255.255.254.0 | 512 | 510 | Large network, multiple floors |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Campus network, small ISP |
| /21 | 255.255.248.0 | 2,048 | 2,046 | Large campus, data center |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Enterprise network |
| /19 | 255.255.224.0 | 8,192 | 8,190 | Large enterprise |
| /18 | 255.255.192.0 | 16,384 | 16,382 | ISP allocation |
| /17 | 255.255.128.0 | 32,768 | 32,766 | Large ISP block |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Class B equivalent, large organization |
| /15 | 255.254.0.0 | 131,072 | 131,070 | Very large allocation |
| /14 | 255.252.0.0 | 262,144 | 262,142 | Regional ISP |
| /13 | 255.248.0.0 | 524,288 | 524,286 | Major ISP allocation |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | Large ISP, cloud provider |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 | Major cloud provider |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 | National ISP |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 | International ISP |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Class A equivalent, massive allocation |
Calculating Usable Hosts Per Subnet
The formula for calculating the number of usable hosts in a subnet is straightforward but essential to understand:
Usable Hosts = 2^(32 - prefix) - 2
The -2 accounts for two reserved addresses in every subnet: the network address (all host bits set to 0) and the broadcast address (all host bits set to 1). These addresses cannot be assigned to individual hosts.
Example calculation for /26:
- Host bits: 32 - 26 = 6 bits
- Total addresses: 2^6 = 64
- Usable hosts: 64 - 2 = 62
There are two important exceptions to this rule:
- /31 subnets: RFC 3021 allows point-to-point links to use both addresses, giving 2 usable hosts instead of 0
- /32 subnets: Represents a single host route, commonly used in routing tables and loopback addresses
Quick tip: When planning network capacity, always add 20-30% overhead to your host count calculations to accommodate future growth and avoid running out of addresses.
IPv4 Address Classes (Legacy)
Before CIDR was introduced in 1993, IPv4 addresses were divided into classes based on the first octet. While classful networking is obsolete, understanding these classes helps when working with legacy systems and documentation.
| Class | First Octet Range | Default Mask | CIDR | Networks | Hosts per Network | Purpose |
|---|---|---|---|---|---|---|
| A | 1.0.0.0 – 126.255.255.255 | 255.0.0.0 | /8 | 126 | 16,777,214 | Large organizations |
| B | 128.0.0.0 – 191.255.255.255 | 255.255.0.0 | /16 | 16,384 | 65,534 | Medium organizations |
| C | 192.0.0.0 – 223.255.255.255 | 255.255.255.0 | /24 | 2,097,152 | 254 | Small organizations |
| D | 224.0.0.0 – 239.255.255.255 | N/A | N/A | N/A | N/A | Multicast |
| E | 240.0.0.0 – 255.255.255.255 | N/A | N/A | N/A | N/A | Reserved/Experimental |
Why classful networking became obsolete: The rigid class structure led to massive IP address waste. A company needing 300 hosts would receive a Class B network with 65,534 addresses, wasting 65,234 addresses. CIDR solved this by allowing flexible subnet sizes.
Note that 127.0.0.0/8 is reserved for loopback addresses and is not part of Class A. The address 127.0.0.1 is the standard loopback address used to refer to the local machine.
Private IP Address Ranges
RFC 1918 defines three IP address ranges reserved for private networks. These addresses are not routable on the public internet, making them ideal for internal networks. Internet routers are configured to drop packets with private IP addresses as source or destination.
| Range | CIDR Notation | Total Addresses | Subnet Mask | Typical Use |
|---|---|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | 255.0.0.0 | Large enterprises, VPNs, cloud infrastructure |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | 255.240.0.0 | Medium networks, corporate LANs |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 | 255.255.0.0 | Home networks, small offices, lab environments |
Choosing the right private range:
- Use
10.0.0.0/8for large organizations with multiple sites or complex network hierarchies - Use
172.16.0.0/12for medium-sized networks or when10.0.0.0/8conflicts with VPN or partner networks - Use
192.168.0.0/16for home networks, small offices, or isolated lab environments
When connecting to VPNs or merging networks, ensure your private IP ranges don't overlap with the remote network's addressing scheme. This is a common source of connectivity issues.
Pro tip: Many home routers default to 192.168.1.0/24 or 192.168.0.0/24. If you're setting up a home lab or need to avoid conflicts, consider using a less common subnet like 192.168.42.0/24 or switching to the 10.0.0.0/8 range.
Special-Use IP Addresses
Beyond private addresses, several IP ranges are reserved for special purposes. Understanding these ranges prevents configuration errors and helps with troubleshooting.
Loopback addresses (127.0.0.0/8): Used to refer to the local machine. The most common is 127.0.0.1, but any address in this range loops back to the local host.
Link-local addresses (169.254.0.0/16): Automatically assigned when DHCP fails. If you see these addresses, it indicates a DHCP configuration problem. Also known as APIPA (Automatic Private IP Addressing) in Windows environments.
Multicast addresses (224.0.0.0/4): Used for one-to-many communication. Common examples include 224.0.0.1 (all hosts on subnet) and 224.0.0.2 (all routers on subnet).
Broadcast address: The last address in any subnet, used to send packets to all hosts on that subnet. For 192.168.1.0/24, the broadcast address is 192.168.1.255.
Documentation addresses (RFC 5737): Three ranges reserved for documentation and examples:
192.0.2.0/24(TEST-NET-1)198.51.100.0/24(TEST-NET-2)203.0.113.0/24(TEST-NET-3)
Carrier-grade NAT (100.64.0.0/10): Reserved for shared address space in service provider networks (RFC 6598).
Practical Subnetting Examples
Let's work through real-world subnetting scenarios to demonstrate how to apply these concepts in practice.
Example 1: Small Office Network
You need to set up a network for an office with 40 computers, 5 printers, and 10 IP phones (55 devices total).
- Required hosts: 55
- Recommended subnet:
/26(62 usable hosts) - Network:
192.168.1.0/26 - Usable range:
192.168.1.1to192.168.1.62 - Broadcast:
192.168.1.63
This provides room for 7 additional devices without reconfiguration.
Example 2: Multi-Department Building
You're designing a network for a building with four departments: Sales (30 hosts), Engineering (50 hosts), HR (15 hosts), and IT (20 hosts).
Using VLSM (covered in the next section), you can efficiently allocate subnets:
- Engineering:
10.1.1.0/26(62 hosts) - Sales:
10.1.1.64/27(30 hosts) - IT:
10.1.1.96/27(30 hosts) - HR:
10.1.1.128/27(30 hosts)
Example 3: Point-to-Point Router Links
You need to connect three routers with point-to-point links. Use /30 subnets to minimize address waste:
- Link 1:
10.0.0.0/30(Router A:10.0.0.1, Router B:10.0.0.2) - Link 2:
10.0.0.4/30(Router B:10.0.0.5, Router C:10.0.0.6) - Link 3:
10.0.0.8/30(Router A:10.0.0.9, Router C:10.0.0.10)
Each link uses only 4 addresses, with 2 usable for the router interfaces.
Quick tip: Use our IP Calculator to quickly determine network addresses, broadcast addresses, and valid host ranges for any subnet configuration.
Variable Length Subnet Masking (VLSM)
VLSM allows you to use different subnet masks within the same network, enabling more efficient IP address allocation. This technique is essential for modern network design.
Benefits of VLSM:
- Reduces IP address waste by matching subnet size to actual requirements
- Allows hierarchical network design
- Supports route summarization for more efficient routing tables
- Provides flexibility for network growth and changes
VLSM Design Process:
- List all network segments and their host requirements
- Sort segments from largest to smallest
- Assign subnets starting with the largest, ensuring no overlap
- Document your addressing scheme thoroughly
VLSM Example: Starting with 172.16.0.0/16, allocate subnets for:
- Data center: 500 hosts →
172.16.0.0/23(510 hosts) - Office LAN: 200 hosts →
172.16.2.0/24(254 hosts) - Guest WiFi: 100 hosts →
172.16.3.0/25(126 hosts) - Management: 50 hosts →
172.16.3.128/26(62 hosts) - DMZ: 10 hosts →
172.16.3.192/28(14 hosts) - Router links: 2 hosts each →
172.16.3.208/30,172.16.3.212/30, etc.
This approach uses address space efficiently while maintaining room for growth in each segment.
Supernetting and Route Aggregation
Supernetting (also called route aggregation or summarization) combines multiple smaller networks into a larger one. This technique reduces routing table size and improves network performance.
Example: If you have four consecutive /24 networks, you can summarize them into a single /22:
192.168.0.0/24192.168.1.0/24192.168.2.0/24192.168.3.0/24
These can be summarized as 192.168.0.0/22, which represents all four networks in a single routing table entry.
Requirements for successful supernetting:
- Networks must be contiguous (consecutive)
- The number of networks must be a power of 2 (2, 4, 8, 16, etc.)
- The first network must start on an appropriate boundary
Route aggregation is crucial for ISPs and large enterprises to keep routing tables manageable. Without it, internet backbone routers would need to maintain millions of individual routes.
Pro tip: When designing your network addressing scheme, plan for future aggregation by allocating address blocks that can be easily summarized. This foresight simplifies routing configuration as your network grows.
Common Subnetting Mistakes to Avoid
Even experienced network engineers occasionally make subnetting errors. Here are the most common pitfalls and how to avoid them.
1. Forgetting to subtract 2 from host calculations
Always remember that the network and broadcast addresses cannot be assigned to hosts. A /24 has 256 total addresses but only 254 usable hosts.
2. Overlapping subnets
When using VLSM, ensure your subnets don't overlap. Use a spreadsheet or network documentation tool to track your allocations. Our Subnet Calculator can help verify that subnets don't conflict.
3. Not planning for growth
Always allocate more addresses than you currently need. A good rule of thumb is to provision for 30-50% growth over the next 3-5 years.
4. Using the wrong subnet mask
Double-check your subnet mask calculations. A single bit error can cause connectivity issues that are difficult to troubleshoot. For example, 255.255.255.0 is /24, not /25.
5. Ignoring private IP ranges
Using public IP addresses for internal networks can cause routing conflicts and security issues. Always use RFC 1918 private addresses for internal networks.
6. Misconfiguring point-to-point links
For router-to-router connections, use /30 or /31 subnets. Using larger subnets like /24 wastes hundreds of addresses per link.
7. Not documenting the addressing scheme
Maintain clear documentation of your subnet allocations, including purpose, VLAN assignments, and contact information. Future you (and your colleagues) will be grateful.
8. Forgetting about special addresses
Remember that 0.0.0.0, 127.0.0.0/8, 169.254.0.0/16, and multicast ranges have special meanings and shouldn't be used for regular host addressing.
Frequently Asked Questions
What is CIDR notation and how do I read it?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its subnet mask compactly, like 192.168.1.0/24. The number after the slash indicates how many bits are used for the network portion. For example, /24 means 24 network bits and 8 host bits, giving 256 total addresses (254 usable). The higher the CIDR number, the smaller the subnet. A /32 is a single host, while /8 is a massive network with over 16 million addresses.
How do I convert between CIDR notation and subnet masks?
To convert CIDR to a subnet mask, create a 32-bit binary number with the first N bits set to 1 (where N is the CIDR number) and the rest set to 0. Then convert to decimal. For example, /24 is 24 ones followed by 8 zeros: 11111111.11111111.11111111.00000000, which equals 255.255.255.0. Going the other way, convert each octet to binary and count the consecutive 1s from the left. Our Subnet Calculator performs these conversions instantly.
What's the difference between /30 and /31 subnets for point-to-point links?
A /30 subnet provides 4 addresses with 2 usable hosts, traditionally used for point-to-point router connections. A