How to Calculate Subnets: A Step-by-Step Guide
Network address, broadcast address, usable host range and CIDR notation โ explained with two fully worked examples you can check by hand.
Why Subnetting Skills Matter
Subnetting comes up constantly in real IT work: configuring a DHCP scope, writing a firewall rule, sizing a VLAN, or working out whether two devices can actually talk to each other. A calculator can give you the answer in seconds, but understanding the math behind it means you can sanity-check the result, explain it to a colleague, and spot a misconfigured network before it causes an outage.
This guide walks through the manual process step by step, using the same logic our Subnet Calculator runs internally, so you can follow along and verify each step by hand.
IP Addresses and CIDR Notation
An IPv4 address such as 192.168.1.0 is really four 8-bit numbers (octets) written in decimal, separated by dots. Each octet ranges from 0 to 255 because that is the full range of an 8-bit binary number (00000000 to 11111111).
CIDR notation, written as /26 after an address, tells you how many of the 32 total bits are fixed as the network portion. The remaining bits belong to the host portion and identify individual devices within that network.
/24= 24 network bits, 8 host bits โ 256 total addresses/26= 26 network bits, 6 host bits โ 64 total addresses/30= 30 network bits, 2 host bits โ 4 total addresses (typically used for point-to-point links)
The number of total addresses in any subnet is always 2^(host bits). Two of those addresses in a standard subnet are reserved: the network address (all host bits set to 0) and the broadcast address (all host bits set to 1). Neither can be assigned to a device.
Worked Example: Calculating a /26 Subnet
Let's calculate everything for 192.168.1.0/26.
Step 1 โ Find the block size. A /26 leaves 6 host bits, so the subnet contains 2โถ = 64 addresses. The subnet mask for /26 is 255.255.255.192, because 192 in binary is 11000000 โ the last two bits (the network bits borrowed from the host portion) are set, leaving a block size of 256 โ 192 = 64.
You can confirm every one of these values instantly with the Subnet Calculator โ useful for double-checking your manual working before you apply a change.
Worked Example: Splitting a /24 Into Four Equal Subnets
A common real-world task: you have 192.168.10.0/24 and need to split it into four separate subnets โ for example, four floors of an office, each on its own VLAN. Splitting into four equal parts means borrowing 2 bits (since 2ยฒ = 4), turning a /24 into four /26 blocks:
Notice each block starts exactly one block size (64) after the previous one. This pattern โ network address, next network address = previous + block size โ is the fastest way to lay out subnets by hand once you know the block size.
Common Mistakes to Avoid
- Assigning the network or broadcast address to a device. Both are reserved and will cause connectivity issues if used.
- Confusing the subnet mask with the wildcard mask. A wildcard mask (used in Cisco ACLs) is the inverse of the subnet mask โ 0.0.0.63 is the wildcard for a /26, not 255.255.255.192. Our CIDR to Wildcard tool converts between the two automatically.
- Forgetting that block size comes from 256 minus the relevant octet value in the mask, not from the CIDR number directly.
- Using fixed equal-sized subnets when requirements differ. If one department needs 100 hosts and another needs 10, splitting everything into equal /26 blocks wastes addresses โ see the VLSM section below.
- Off-by-one errors when counting usable hosts. Usable hosts = total addresses โ 2, except for /31 (point-to-point links, 2 usable addresses under RFC 3021) and /32 (a single host route).
When You Need VLSM Instead of Fixed Subnetting
Fixed-size subnetting works well when every subnet needs roughly the same number of hosts. But real networks rarely look like that โ a server VLAN might need 50 addresses, a guest Wi-Fi network might need 20, and a router-to-router link only needs 2. Forcing all of these into equal-sized /26 blocks wastes a large amount of address space.
Variable Length Subnet Masking (VLSM) solves this by allocating a differently-sized block to each subnet based on its actual host requirement, starting with the largest requirement first. Our VLSM Subnet Planner automates this โ enter your required host counts and it assigns the smallest subnet that fits each one, with no manual trial and error.
Tools For This Guide
Frequently Asked Questions
Verify Your Subnetting Instantly
Skip the manual math next time โ enter an IP and CIDR prefix and get every value instantly, right in your browser.