What Is a Subnet Calculator?
A subnet calculator is an essential tool for network administrators and engineers who need to plan and manage IP address allocation. It takes an IP address and a CIDR prefix length as input and instantly computes the subnet mask, network address, broadcast address, and the range of usable host addresses within that subnet.
Subnetting allows you to divide a single, large network into smaller, more manageable segments. This is critical for reducing broadcast traffic, improving security by isolating groups of devices, and making efficient use of limited IP address space. Without proper subnetting, organizations would waste addresses and struggle with congested, poorly segmented networks.
Whether you are setting up a home lab, designing a corporate campus network, or configuring cloud VPCs, a subnet calculator saves time and eliminates the error-prone process of manually computing binary masks and address boundaries.
How Subnetting Works
Every IPv4 address is a 32-bit number, typically written as four decimal octets separated by dots (e.g., 192.168.1.1). Subnetting divides those 32 bits into two parts: the network portion and the host portion. The network portion identifies which subnet an address belongs to, while the host portion identifies the specific device within that subnet.
The division point is expressed using CIDR notation. A prefix like /24 means the first 24 bits are the network portion and the remaining 8 bits are the host portion. The longer the prefix, the more bits are dedicated to identifying the network, which means fewer bits are available for hosts — and therefore fewer devices can exist on that subnet.
The number of usable host addresses in a subnet is calculated as 2(32 - prefix length) minus 2. The two addresses subtracted are the network address (all host bits set to 0) and the broadcast address (all host bits set to 1), neither of which can be assigned to a device. For example, a /24 subnet gives 28 - 2 = 254 usable host addresses.
Common Subnet Masks
The table below shows frequently used CIDR prefix lengths along with their corresponding subnet masks, usable host counts, and typical use cases.
| CIDR | Subnet Mask | Usable Hosts | Typical Use |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | Single host |
| /30 | 255.255.255.252 | 2 | Point-to-point link |
| /24 | 255.255.255.0 | 254 | Small LAN |
| /16 | 255.255.0.0 | 65,534 | Medium network |
| /8 | 255.0.0.0 | 16,777,214 | Large network |
Learn More
Read our in-depth guide to understand the concepts behind this tool:
- What Is a Subnet Mask? — How subnetting works, CIDR notation, VLSM, and practical examples.
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation is a compact way to specify an IP address and its associated network mask. For example, 192.168.1.0/24 means the first 24 bits identify the network, leaving 8 bits for host addresses.
How many usable hosts are in a /24 subnet?
A /24 subnet has 256 total addresses (28), but 2 are reserved: one for the network address and one for the broadcast address. That leaves 254 usable host addresses.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask uses 1-bits for the network portion and 0-bits for the host portion (e.g., 255.255.255.0). A wildcard mask is the inverse — it uses 0-bits for the network and 1-bits for the host portion (e.g., 0.0.0.255). Wildcard masks are commonly used in router access control lists (ACLs).
Can I subnet an already-subnetted network?
Yes. You can take any subnet and divide it further by increasing the prefix length. For example, a /24 network can be split into two /25 networks, four /26 networks, and so on.