Subnet Calculator
Enter an IP address in CIDR notation to calculate network address, broadcast address, subnet mask, and usable hosts.
What Is a Subnet Calculator?
A subnet calculator is a networking tool that helps IT professionals, network administrators, students, and CCNA/CCNP candidates compute IP subnet information from CIDR notation or subnet masks. It calculates network addresses, broadcast addresses, usable host ranges, subnet masks, and total number of available IP addresses for any given IPv4 subnet.
Whether you're designing a corporate network, configuring routers, studying for networking certifications, or troubleshooting connectivity issues, this free subnet calculator provides instant accurate results without signup. It supports both classful (Class A, B, C) and classless inter-domain routing (CIDR) calculations.
For other technical calculations, see our Basic Calculator for general math and Scientific Calculator for advanced computations.
Understanding Subnets and CIDR Notation
Subnetting is the process of dividing a large network into smaller, manageable sub-networks (subnets). This improves security, reduces broadcast traffic, simplifies management, and enables efficient IP address allocation.
CIDR (Classless Inter-Domain Routing) notation expresses subnet masks as a prefix length after the IP address, like 192.168.1.0/24. The number after the slash indicates how many bits are used for the network portion.
How CIDR Works
An IPv4 address has 32 bits. CIDR splits these between network bits and host bits:
Total IPs = 2(32 − CIDR)
Usable Hosts = Total IPs − 2 (network + broadcast)
Example: For 192.168.1.0/24:
- Network bits: 24, Host bits: 32 − 24 = 8
- Total IPs = 28 = 256
- Usable hosts = 256 − 2 = 254
- Network address: 192.168.1.0
- Broadcast address: 192.168.1.255
- Usable range: 192.168.1.1 to 192.168.1.254
Common CIDR References Table
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Use Case |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Class A networks |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Class B networks |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large enterprise |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Medium business |
| /24 | 255.255.255.0 | 256 | 254 | Small office/Class C |
| /25 | 255.255.255.128 | 128 | 126 | Half subnet |
| /26 | 255.255.255.192 | 64 | 62 | Quarter subnet |
| /27 | 255.255.255.224 | 32 | 30 | Department subnet |
| /28 | 255.255.255.240 | 16 | 14 | Small team |
| /29 | 255.255.255.248 | 8 | 6 | Point-to-point + hosts |
| /30 | 255.255.255.252 | 4 | 2 | Router-to-router links |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | P2P modern |
| /32 | 255.255.255.255 | 1 | 1 | Single host route |
IP Address Classes
Before CIDR (introduced in 1993), IP addresses were divided into fixed classes:
| Class | Range | Default Mask | Networks | Hosts per Network |
|---|---|---|---|---|
| Class A | 1.0.0.0 to 126.255.255.255 | /8 (255.0.0.0) | 126 | 16,777,214 |
| Class B | 128.0.0.0 to 191.255.255.255 | /16 (255.255.0.0) | 16,384 | 65,534 |
| Class C | 192.0.0.0 to 223.255.255.255 | /24 (255.255.255.0) | 2,097,152 | 254 |
| Class D | 224.0.0.0 to 239.255.255.255 | N/A (Multicast) | N/A | N/A |
| Class E | 240.0.0.0 to 255.255.255.255 | N/A (Reserved) | N/A | N/A |
Private IP Address Ranges (RFC 1918)
These ranges are reserved for internal networks and never routed on the public internet:
- 10.0.0.0/8 (10.0.0.0 to 10.255.255.255) — Large enterprises, 16.7 million addresses
- 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) — Medium networks, ~1 million addresses
- 192.168.0.0/16 (192.168.0.0 to 192.168.255.255) — Home/small office, 65,536 addresses
The 192.168.1.0/24 subnet is the most common home router default, used by millions of households globally.
How to Use This Subnet Calculator
- Enter the IP address — In dotted decimal notation (e.g., 192.168.1.0)
- Enter CIDR prefix or subnet mask — /24 or 255.255.255.0
- View results:
- Network address
- Broadcast address
- First and last usable host IPs
- Total number of hosts
- Wildcard mask
- Binary representation
VLSM (Variable Length Subnet Masking)
VLSM allows different subnets within the same network to have different sizes, optimizing IP address usage. Instead of wasting addresses with uniform subnetting, you allocate exactly what each subnet needs.
Example: A company has a 192.168.1.0/24 network and needs:
- 50 hosts for Sales department
- 25 hosts for HR
- 10 hosts for Management
- 2 hosts for router-to-router link
VLSM allocation (most efficient):
- Sales: 192.168.1.0/26 (62 usable hosts)
- HR: 192.168.1.64/27 (30 usable hosts)
- Management: 192.168.1.96/28 (14 usable hosts)
- P2P link: 192.168.1.112/30 (2 usable hosts)
Without VLSM, you'd waste hundreds of addresses by using uniform subnet sizes.
Subnetting Best Practices
- Plan for growth: Allocate 20-30% extra capacity per subnet
- Document everything: Maintain subnet allocation tables and IP address management (IPAM) tools
- Use private ranges internally: Don't use public IPs for internal LAN
- Implement VLAN per subnet: Logical separation enhances security
- Reserve subnet zero: Some older equipment can't use subnet 0 or broadcast subnet
- Consider IPv6 migration: Eventually, all networks will move beyond IPv4
- Group by function/department: Easier to apply ACLs and policies
- Use /30 or /31 for P2P links: Don't waste full subnets on point-to-point connections
Common Subnetting Mistakes
- Forgetting reserved addresses: Network and broadcast addresses can't be assigned to hosts
- Overlapping subnets: Causes routing chaos and connectivity issues
- Using /31 incorrectly: Only works on RFC 3021 compliant devices for P2P
- Wrong default gateway: Must be in same subnet as host
- Confusing classful vs classless: Modern routing is all classless
- Inadequate planning: Running out of IPs forces difficult renumbering later
- Ignoring DHCP scope conflicts: Static and dynamic ranges must not overlap
IPv6 vs IPv4 Subnetting
IPv6 dramatically changes subnetting:
- IPv4: 32-bit addresses, 4.3 billion total
- IPv6: 128-bit addresses, 340 undecillion total (340 followed by 36 zeros)
- IPv6 standard subnet: /64 provides 18 quintillion addresses per subnet
- No NAT needed: Every device can have a public IP
- Simpler structure: First 64 bits = network, last 64 bits = host
IPv4 still dominates today, but IPv6 adoption is growing as IPv4 address space depletes. Most modern operating systems support both.