Subnet Calculator: How to Calculate Subnets, CIDR & VLSM
Subnetting is one of the most important skills in networking. Whether you're designing a corporate network, studying for a certification like CCNA, or just trying to understand how IP addresses are organized, subnetting is foundational knowledge. In this guide, we'll break down everything from basic concepts to advanced VLSM โ and show you how to use the NetLynx Subnet Calculator to do the math instantly.
What Is Subnetting?
Subnetting is the process of dividing a large network into smaller, more manageable sub-networks (subnets). Instead of having one massive network with thousands of devices all in the same broadcast domain, subnetting lets you create logical segments that improve performance, security, and organization.
Every IP address has two components:
- Network portion: Identifies which network the device belongs to
- Host portion: Identifies the specific device within that network
The subnet mask determines where the boundary falls between these two portions.
Why Do We Subnet?
- Reduce broadcast traffic: Smaller subnets mean fewer devices receiving broadcast packets, improving network performance.
- Improve security: Isolate departments or sensitive systems into separate subnets with firewall rules between them.
- Efficient IP allocation: Avoid wasting addresses by sizing subnets to match the actual number of hosts needed.
- Simplified management: Troubleshooting and monitoring are easier when the network is logically organized.
Understanding Subnet Masks
A subnet mask is a 32-bit number that masks the network portion of an IP address. It's written in the same dotted-decimal format as an IP address:
IP Address: 192.168.1.100
Subnet Mask: 255.255.255.0
Binary:
IP: 11000000.10101000.00000001.01100100
Mask: 11111111.11111111.11111111.00000000
|-------- Network --------|- Host -|
The 1s in the mask represent the network bits, and the 0s represent the host bits. In this example, the first 24 bits are the network, leaving 8 bits for hosts โ giving us 256 addresses (254 usable, since the first is the network address and the last is the broadcast address).
CIDR Notation Explained
CIDR (Classless Inter-Domain Routing) notation is a shorthand way to express subnet masks. Instead of writing 255.255.255.0, you write /24 โ the number after the slash represents how many bits are used for the network portion.
Here are the most common CIDR prefixes:
CIDR Subnet Mask Usable Hosts Typical Use
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
/8 255.0.0.0 16,777,214 Large enterprise
/16 255.255.0.0 65,534 Campus network
/20 255.255.240.0 4,094 Large department
/24 255.255.255.0 254 Standard LAN
/25 255.255.255.128 126 Small office
/26 255.255.255.192 62 Team subnet
/27 255.255.255.224 30 Small group
/28 255.255.255.240 14 Point-to-point+
/30 255.255.255.252 2 Point-to-point link
/32 255.255.255.255 1 Single host
Calculating Network and Broadcast Addresses
For any given IP address and subnet mask, you can calculate two critical addresses:
- Network Address: The first address in the subnet (all host bits set to 0). This identifies the subnet itself.
- Broadcast Address: The last address in the subnet (all host bits set to 1). Packets sent here reach every device on the subnet.
Let's calculate these for 192.168.1.130/26:
IP: 192.168.1.10000010 (130 in binary)
Mask /26: 255.255.255.11000000
Network bits: 10 (first 2 bits of last octet)
Host bits: 000010 (last 6 bits)
Network Address: 192.168.1.10000000 = 192.168.1.128
Broadcast Address: 192.168.1.10111111 = 192.168.1.191
Usable Range: 192.168.1.129 โ 192.168.1.190
Usable Hosts: 62
VLSM: Variable Length Subnet Masking
VLSM takes subnetting further by allowing you to create subnets of different sizes within the same network. This is how real-world networks are designed โ different departments need different numbers of addresses.
Practical Example: Office with 3 Departments
Imagine you have the network 192.168.10.0/24 (254 usable addresses) and need to create subnets for:
- Engineering: 100 hosts
- Marketing: 50 hosts
- Management: 20 hosts
With VLSM, you allocate from largest to smallest:
1. Engineering (100 hosts) โ /25 (126 usable)
Network: 192.168.10.0/25
Range: 192.168.10.1 โ 192.168.10.126
Broadcast: 192.168.10.127
2. Marketing (50 hosts) โ /26 (62 usable)
Network: 192.168.10.128/26
Range: 192.168.10.129 โ 192.168.10.190
Broadcast: 192.168.10.191
3. Management (20 hosts) โ /27 (30 usable)
Network: 192.168.10.192/27
Range: 192.168.10.193 โ 192.168.10.222
Broadcast: 192.168.10.223
Remaining: 192.168.10.224/27 (available for future use)
This approach wastes far fewer addresses than using a single /24 subnet or three equal-sized subnets.
Subnetting Tips for Network Design
- Always plan for growth. If a department has 50 hosts now, allocate for at least 75โ100 to avoid re-addressing later.
- Reserve subnets for infrastructure. Management VLANs, server subnets, and point-to-point links all need their own space.
- Use /30 or /31 for router links. Point-to-point connections between routers only need 2 addresses.
- Document everything. Maintain an IP address management (IPAM) spreadsheet or tool with every subnet, its purpose, and assigned devices.
- Align subnets to power-of-2 boundaries. This simplifies routing tables and avoids overlapping address spaces.
Use the NetLynx Subnet Calculator
Whether you're studying for an exam or designing a production network, our Subnet Calculator makes it effortless. Enter any IP address with a CIDR prefix and instantly get the network address, broadcast address, usable host range, wildcard mask, total hosts, and binary breakdown. It's free, fast, and works right in your browser.
Written by the NetLynx Team ยท March 22, 2025
Try Our Subnet Calculator โ