Subnet Calculator
Calculate subnet mask, network address, broadcast address, and host range from IP address and CIDR notation.
How to use:
Enter an IP address and CIDR notation (e.g., /24) to calculate all subnet information including network address, broadcast address, and usable host range.
Published: December 2025 | Author: TriVolt Editorial Team | Last Updated: February 2026
Understanding Subnetting
Subnetting is the practice of dividing a network into smaller, more manageable subnetworks (subnets). This fundamental networking concept allows network administrators to organize networks efficiently, improve security, reduce broadcast traffic, and optimize IP address allocation. Understanding subnetting is essential for anyone working with IP networks, from network administrators to IT professionals.
Subnetting uses subnet masks to define which portion of an IP address identifies the network and which portion identifies the host. CIDR (Classless Inter-Domain Routing) notation provides a compact way to represent subnet masks and network sizes.
CIDR Notation
CIDR notation expresses a subnet mask as a slash followed by a number (e.g., /24). This number represents how many bits are used for the network portion of the address:
- /24: 24 bits for network, 8 bits for hosts (256 addresses, 254 usable)
- /25: 25 bits for network, 7 bits for hosts (128 addresses, 126 usable)
- /26: 26 bits for network, 6 bits for hosts (64 addresses, 62 usable)
- /28: 28 bits for network, 4 bits for hosts (16 addresses, 14 usable)
- /30: 30 bits for network, 2 bits for hosts (4 addresses, 2 usable - common for point-to-point links)
The formula for usable hosts is: 2(32-CIDR) - 2 (subtracting network and broadcast addresses).
Subnet Components
Network Address
The network address is the first address in a subnet and identifies the subnet itself. All host bits are set to 0. This address cannot be assigned to a host.
Broadcast Address
The broadcast address is the last address in a subnet, used to send data to all hosts in the subnet. All host bits are set to 1. This address cannot be assigned to a host.
Host Range
The usable host addresses are all addresses between the network address and broadcast address. These are the addresses that can be assigned to devices.
Subnet Mask
The subnet mask defines which bits belong to the network portion. It's written in dotted decimal notation (e.g., 255.255.255.0 for /24) or CIDR notation (/24).
Wildcard Mask
The wildcard mask is the inverse of the subnet mask, used in access control lists and routing protocols. It's calculated by subtracting each octet of the subnet mask from 255.
Practical Applications
Network Segmentation
Subnetting allows dividing a large network into smaller segments, improving organization and management. Different departments or functions can have their own subnets.
Security
Subnets can be isolated with firewalls and access control lists, limiting communication between network segments and improving security.
Broadcast Domain Reduction
Smaller subnets reduce broadcast traffic, improving network performance. Broadcasts are contained within each subnet.
IP Address Conservation
Subnetting allows efficient use of IP address space by creating appropriately sized networks rather than using fixed class-based networks.
VLAN Implementation
Subnets often correspond to VLANs (Virtual LANs), allowing logical network separation on the same physical infrastructure.
Real-World Examples
Example 1: /24 Subnet (192.168.1.0/24)
Network Address: 192.168.1.0
Subnet Mask: 255.255.255.0
Broadcast Address: 192.168.1.255
Usable Host Range: 192.168.1.1 to 192.168.1.254 (254 hosts)
Total Addresses: 256 (254 usable + network + broadcast)
Example 2: /28 Subnet (10.0.0.0/28)
Network Address: 10.0.0.0
Subnet Mask: 255.255.255.240
Broadcast Address: 10.0.0.15
Usable Host Range: 10.0.0.1 to 10.0.0.14 (14 hosts)
Total Addresses: 16 (14 usable + network + broadcast)
Example 3: /30 Subnet (172.16.1.0/30)
Network Address: 172.16.1.0
Subnet Mask: 255.255.255.252
Broadcast Address: 172.16.1.3
Usable Host Range: 172.16.1.1 to 172.16.1.2 (2 hosts)
Use: Point-to-point links (router-to-router connections)
Subnetting Best Practices
- Plan for Growth: Leave room for future expansion when designing subnets
- Use Appropriate Sizes: Don't waste IP addresses with oversized subnets
- Document Everything: Maintain clear documentation of subnet allocations
- Follow Conventions: Use consistent numbering schemes (e.g., .0 for network, .1 for gateway)
- Consider Routing: Ensure subnets align with routing table capabilities
- Security Zones: Use subnets to separate security zones (DMZ, internal, management)
Important Considerations
Private vs. Public IP Addresses
Private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are used for internal networks. Public IP addresses are routable on the internet and must be unique globally.
Default Gateway
Typically, the first usable host address (e.g., .1) is assigned to the default gateway/router for the subnet.
DHCP Considerations
When using DHCP, reserve addresses for static devices and ensure the DHCP pool doesn't conflict with static assignments.
Supernetting
The opposite of subnetting, supernetting (route aggregation) combines multiple subnets into larger networks for efficient routing.
Tips for Using This Calculator
- Enter IP address in dotted decimal notation (e.g., 192.168.1.100)
- CIDR notation ranges from /0 to /32
- Common CIDR values: /24 (256 hosts), /25 (128 hosts), /26 (64 hosts), /28 (16 hosts), /30 (4 hosts)
- Results show all subnet information including network, broadcast, and host ranges
- Wildcard mask is useful for access control lists and routing protocols
- Remember: network and broadcast addresses cannot be assigned to hosts
- For complex subnetting scenarios, consider using VLSM (Variable Length Subnet Masking)
Common Pitfalls
Confusing network address with gateway. The network address (first IP, all host bits 0) identifies the subnet itself and cannot be assigned to a host. The gateway is a router address that is assigned to a host — conventionally the first usable address (.1). Typing 192.168.1.0 as a default gateway breaks connectivity everywhere.
Forgetting the -2 rule (and when it doesn't apply). The usable-host formula 2h − 2 subtracts the network and broadcast addresses. But /31 networks (RFC 3021) are valid for point-to-point links and use both addresses as hosts — giving 2 usable, not 0. /32 defines a single host (loopback or VPN tunnel endpoint) and has no network/broadcast concept at all.
Subnet mask vs. wildcard mask mix-up. Cisco ACLs, EIGRP, and OSPF use wildcard masks (bits inverted from the subnet mask). 255.255.255.0 becomes 0.0.0.255. Pasting a subnet mask into an ACL statement silently matches a completely different range of hosts. Our calculator displays both so you can copy the right one.
Overlapping subnets. 10.0.0.0/23 covers 10.0.0.0–10.0.1.255. A 10.0.1.0/24 created elsewhere overlaps and breaks routing decisions — the more specific prefix wins, but any device trying to summarize will advertise conflicting routes. Always verify with the VLSM Calculator when carving up a supernet.
Assuming /24 holds exactly 256 hosts. 256 total addresses, 254 usable, 1 network, 1 broadcast. Engineers undersize printer segments by planning for "256 devices in a /24" and hit the wall at #255.
Frequently Asked Questions
What CIDR gives me a subnet for 50 hosts?
Solve 2h − 2 ≥ 50 → h = 6 → 32 − 6 = /26. A /26 provides 62 usable addresses. A /27 (30 usable) is too small; a /25 (126 usable) wastes three-quarters of the space. For 50–60 host segments, /26 is the right starting point.
Why does my server in 10.1.5.200/22 still ping my laptop in 10.1.7.50/22?
Because a /22 covers 10.1.4.0 through 10.1.7.255 — both addresses fall in the same broadcast domain. The third octet gives no clue about subnet boundaries; only the CIDR does. Use this calculator to confirm the range whenever you see large prefixes spanning multiple octets.
What's the relationship between subnets and VLANs?
A VLAN is an L2 broadcast domain; a subnet is an L3 address block. Best practice is one subnet per VLAN — but they're technically independent. Multi-subnet VLANs (secondary IP ranges) exist in transition scenarios, and a single subnet can span multiple VLANs in private VLAN configurations. For routing and ACLs, what matters is the L3 subnet, not the VLAN tag.
Can I use .0 or .255 as a host address on a /23 or larger?
Yes — only the network's own broadcast and network addresses are reserved. On a 10.0.0.0/23 network, 10.0.0.255 and 10.0.1.0 are regular host addresses. The reserved ones are 10.0.0.0 (network) and 10.0.1.255 (broadcast). Confusing octet-boundary patterns with reserved addresses causes a lot of phantom "host unreachable" bugs.
How does this apply to IPv6?
Conceptually similar — CIDR notation works the same way — but the prefix lengths differ. IPv6 subnets are almost universally /64 (to support SLAAC), and LAN allocations from an ISP are typically /48 or /56. The network-and-broadcast concept disappears in IPv6; all addresses in a subnet are usable. This calculator is IPv4-only.
Disclaimer
This calculator is provided for educational and informational purposes only. While we strive for accuracy, users should verify all calculations independently, especially for critical applications. We are not responsible for any errors, omissions, or damages arising from the use of this calculator.
Related Network Calculators
Explore other network engineering tools that complement subnetting:
- → VLSM Calculator - Variable Length Subnet Masking for efficient IP allocation
- → Supernet Calculator - Route summarization and CIDR aggregation
- → IP Address Converter - Convert between decimal, binary, and hex IP formats
- → Wildcard Mask Calculator - Convert subnet masks to wildcard masks for ACLs
- → Bandwidth Calculator - Calculate data transfer rates and throughput