🌐

Subnet Calculator

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

TL;DR

Enter any IPv4 address and a CIDR prefix length to instantly see the network address, broadcast address, subnet mask, and usable host range. The calculator applies a bitwise AND between the IP and the subnet mask to derive all values. Perfect for network planning, subnetting practice, or quick on-the-job lookups.

A /24 network gives 254 usable host addresses. The table below lists every prefix from /8 to /32 with host count and subnet mask.

/

Subnet table: prefix, usable hosts and subnet mask

Prefix Usable hostsTotal addresses
8 1677721416777216
9 83886068388608
10 41943024194304
11 20971502097152
12 10485741048576
13 524286524288
14 262142262144
15 131070131072
16 6553465536
17 3276632768
18 1638216384
19 81908192
20 40944096
21 20462048
22 10221024
23 510512
24 254256
25 126128
26 6264
27 3032
28 1416
29 68
30 24
31 22
32 11

Common questions with concrete values

How do you calculate a subnet?

You take the IP address and the prefix length (or subnet mask), convert both to binary and apply a bitwise AND to get the network address; the host bits set to all ones give the broadcast address, and everything in between is the usable host range. Enter the address and prefix above and the network, broadcast, mask and host range are worked out for you.

What does an IP address with a subnet mask of 255.255. 255.0 mean?

It means the first three octets identify the network and only the last octet identifies the host, so all addresses that share those three octets are on the same local network. This mask is the same as prefix /24 and is the classic mask for small LANs.

How many subnets are in a 24?

That depends on how far you split it: a /24 can be divided into smaller equal blocks by borrowing host bits, and each extra bit you borrow doubles the number of subnets while halving the hosts per subnet. Pick the target prefix in the calculator to see the resulting subnet count and host range.

How do I check my subnet?

On Windows run ipconfig in the command prompt and read the "Subnet Mask" line; on macOS and Linux use ifconfig or ip addr, where the prefix is shown after the slash. Paste that address and mask into the calculator to see the network, broadcast and host range.

How to check if an IP address is in a subnet?

Apply the subnet mask to both the address you are testing and the network address — if both AND results are identical, the address belongs to that subnet. In practice it is easier to compare the address against the network's first and last address, which the calculator lists for you.

Why is 192.168.1.1 so popular?

It sits in the private IPv4 range reserved for local networks, and most consumer router vendors ship it as the default gateway address and web interface address. Because it is private, it is never routed on the public internet, so every home network can reuse it.

How do I subnet my home network?

Split your existing private range into smaller blocks with a longer prefix, assign each block to a separate VLAN or interface on a router that supports it, and give every subnet its own gateway and DHCP scope. Typical reasons are separating guests, IoT devices and cameras from your main network.

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 Checker ⏱ Unix Timestamp Converter 🔵 Color Converter 🖥️ Screen Size Calculator 📐 Aspect Ratio Calculator

More Calculators

💪 Body Fat Calculator 🪜 Staircase Calculator 💰 Margin & Markup Calculator