🌐

Subnet Calculator

IP + CIDR → network address, broadcast, host range & subnet mask

/

Subnet Calculator: Instantly Compute Network Details from IP & CIDR

Whether you're a network engineer designing a corporate infrastructure, a student studying for your CCNA certification, or a cloud architect provisioning virtual networks, understanding subnets is essential. Our free Subnet Calculator takes any IPv4 address combined with a CIDR prefix length and instantly returns the network address, broadcast address, usable host range, subnet mask, and total host count.

What Is Subnetting and Why Does It Matter?

Subnetting is the practice of dividing a larger IP network into smaller, logically isolated sub-networks. This technique is fundamental to modern networking because it optimizes IP address allocation, reduces unnecessary broadcast traffic, and enhances network security by segmenting different groups of devices.

Imagine a mid-sized company with 500 employees spread across three departments. Instead of placing every device on a single flat network, the IT team can create separate subnets for Finance, Engineering, and Operations. Each subnet limits broadcast domains, allows targeted firewall policies, and makes troubleshooting significantly easier.

Understanding CIDR Notation

CIDR (Classless Inter-Domain Routing) notation expresses a network as an IP address followed by a slash and a prefix length — for example, 192.168.1.0/24. The number after the slash indicates how many bits are used for the network portion. The remaining bits define the host space. A /24 means 24 network bits and 8 host bits, allowing up to 254 usable hosts.

  • /8 – Over 16 million hosts (Class A equivalent)
  • /16 – Over 65,000 hosts (Class B equivalent)
  • /24 – 254 usable hosts (Class C equivalent)
  • /28 – 14 usable hosts, ideal for small segments
  • /30 – 2 usable hosts, perfect for point-to-point links

How to Use the Subnet Calculator

Using our subnet calculator is straightforward. Simply enter an IP address along with its CIDR prefix (e.g., 10.10.5.100/22) and click Calculate. The tool immediately returns:

  • Network Address: The base address that identifies the subnet
  • Subnet Mask: In dotted-decimal notation (e.g., 255.255.252.0)
  • Broadcast Address: The last address used to reach all hosts simultaneously
  • First Usable Host: The lowest assignable IP in the subnet
  • Last Usable Host: The highest assignable IP in the subnet
  • Total Usable Hosts: Number of devices the subnet can accommodate

Step-by-Step Example: 172.16.50.200/20

Let's work through 172.16.50.200/20. A /20 prefix uses 20 bits for the network, leaving 12 bits for hosts (4,096 addresses total). The calculator produces:

  • Network Address: 172.16.48.0
  • Subnet Mask: 255.255.240.0
  • Broadcast Address: 172.16.63.255
  • First Usable Host: 172.16.48.1
  • Last Usable Host: 172.16.63.254
  • Usable Hosts: 4,094

This kind of result is invaluable when configuring routers, setting up DHCP scopes, or writing access control lists (ACLs).

Real-World Use Cases

The subnet calculator is used daily by networking professionals across many scenarios:

  • Enterprise Network Design: Allocating IP blocks to departments, floors, or buildings in a corporate campus.
  • Cloud Networking: Defining VPC subnets in AWS, Azure, or Google Cloud Platform requires precise CIDR planning to avoid overlaps.
  • Certification Exam Prep: CCNA, CompTIA Network+, and other exams test subnet calculation skills — use this tool to verify your manual work.
  • Home Lab Setup: Enthusiasts building home labs with VLANs and pfSense or OPNsense routers rely on correct subnet math.
  • Network Troubleshooting: Quickly verify whether two IP addresses belong to the same subnet when diagnosing connectivity issues.

Common Subnetting Mistakes to Avoid

Even experienced engineers sometimes make subnetting errors. Here are the most common pitfalls:

  • Assigning the network address or broadcast address to a host — both are reserved and cannot be used.
  • Overlapping subnets in routing tables, which causes unpredictable traffic paths.
  • Using a /32 mask for anything other than a single host route or loopback address.
  • Forgetting that gateway routers consume one usable host address per subnet interface.

Frequently Asked Questions (FAQ)

What is the difference between a subnet mask and a CIDR prefix?

They represent the same concept in different formats. A subnet mask like 255.255.255.0 uses dotted-decimal notation, while the CIDR prefix /24 expresses the same information as a bit count. Both indicate that 24 bits are reserved for the network portion of the address.

How many hosts can a /29 subnet support?

A /29 subnet has 8 total addresses (2³). Subtracting the network and broadcast addresses leaves 6 usable host addresses. It's commonly used for small network segments or router interconnects.

Can I use this calculator for private IP ranges?

Absolutely. The calculator works for all valid IPv4 addresses including private ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, as well as public IP ranges. The subnet math is identical regardless of the address class.

What does a /32 subnet mean?

A /32 subnet represents a single host address — there are no additional host bits. It is used in routing tables to define a specific host route or in configurations like loopback interfaces. There are 0 usable hosts in the traditional sense, as the single address is both network and host.

Is this tool useful for IPv6 subnetting?

This calculator is optimized for IPv4 subnetting. IPv6 uses 128-bit addresses and different subnetting conventions, so a dedicated IPv6 tool would be more appropriate for those calculations.

Related Calculators

🔐 Password Strength Calculator ⏱ Unix Timestamp Converter 🔵 Colour Converter 🖥️ Screen Size Calculator