Subnet Calculator Guide: CIDR, Network and Host Addresses
A subnet calculator helps you understand how an IP address belongs to a network, how large an address block is, and where its network and broadcast boundaries fall. This guide explains CIDR notation, IPv4 subnet calculations, host counts, IPv6 prefixes and common mistakes.
What Is a Subnet?
An IP network can be divided into smaller logical networks called subnets. Subnetting helps administrators organize address space, separate network segments and plan routing.
An IP address alone does not tell you the size of its network. The CIDR prefix length supplies that information.
For example, 192.168.1.70/26 contains an IPv4 address and a prefix length of 26 bits.
Understanding CIDR Notation
CIDR stands for Classless Inter-Domain Routing. The number after the slash indicates how many leading bits identify the network prefix.
/24uses 24 network bits and leaves 8 bits for the remaining address space./25uses 25 network bits and leaves 7 bits./26uses 26 network bits and leaves 6 bits.
IPv4 addresses contain 32 bits. As the prefix length increases, the number of addresses in the block decreases.
How IPv4 Subnet Calculations Work
Three important results are:
- Network address: identifies the beginning of the subnet.
- Broadcast address: identifies the final address in a conventional IPv4 subnet where broadcast addressing applies.
- Address count: the total number of IPv4 addresses in the block.
The total address count is calculated as:
For many conventional IPv4 subnets, the network and broadcast addresses are excluded from ordinary host assignments. This convention does not apply in the same way to every prefix, especially /31 and /32.
Worked Example: 192.168.1.70/26
Suppose a network administrator wants to identify the subnet containing 192.168.1.70/26.
Step 1: Find the Host-Bit Count
IPv4 has 32 bits. A /26 prefix leaves:
Step 2: Calculate the Total Number of Addresses
Raise 2 to the power of the number of remaining bits:
Step 3: Identify the Subnet Boundaries
A /26 block contains 64 addresses. In the 192.168.1.0/24 range, the /26 blocks begin at .0, .64, .128 and .192.
The address .70 falls within the block that starts at .64.
The resulting subnet information is:
| Property | Result |
|---|---|
| IP address entered | 192.168.1.70 |
| CIDR prefix | /26 |
| Subnet mask | 255.255.255.192 |
| Network address | 192.168.1.64 |
| First conventional usable host | 192.168.1.65 |
| Last conventional usable host | 192.168.1.126 |
| Broadcast address | 192.168.1.127 |
| Total addresses | 64 |
| Conventional usable host addresses | 62 |
These usable-host figures follow the traditional IPv4 subnet convention.
Comparing Common IPv4 Prefixes
| CIDR Prefix | Subnet Mask | Total Addresses | Conventional Usable Hosts |
|---|---|---|---|
/24 |
255.255.255.0 |
256 | 254 |
/25 |
255.255.255.128 |
128 | 126 |
/26 |
255.255.255.192 |
64 | 62 |
/27 |
255.255.255.224 |
32 | 30 |
/28 |
255.255.255.240 |
16 | 14 |
/29 |
255.255.255.248 |
8 | 6 |
/30 |
255.255.255.252 |
4 | 2 |
The conventional usable-host column is intended for ordinary IPv4 subnets. Special-purpose configurations may follow different rules.
How to Use a Subnet Calculator
- Open the Tervilo Subnet Calculator.
- Enter a valid IP address in the format requested by the tool.
- Enter the CIDR prefix length, such as
/24or/26, if the tool asks for it separately. - Calculate the result.
- Review the network address, subnet mask, broadcast address, address count and other fields provided.
- Compare the result with your network plan before using it in a device or router configuration.
If the result looks unexpected, check that the IP address is valid and that the prefix length is within the permitted range for the address family.
Understanding IPv6 Prefixes
IPv6 addresses contain 128 bits, compared with 32 bits in IPv4. An IPv6 prefix such as /64 identifies the first 64 bits as the network prefix.
IPv6 uses different addressing conventions from IPv4. In particular, the familiar IPv4 network-address and broadcast-address model should not be applied directly to IPv6. IPv6 does not use broadcast addressing in the same way.
The number of addresses in an IPv6 prefix can be calculated from the number of bits remaining after the prefix. However, the practical use of those addresses depends on the network design and allocation rules.
Common Subnetting Mistakes
- Ignoring the prefix length: the same IP address can belong to different subnets depending on its prefix.
- Confusing total addresses with usable hosts: these values are not always the same.
- Applying conventional host counts to every prefix:
/31and/32require special consideration. - Treating an address range as proof of availability: a calculated address may already be assigned or restricted by network policy.
- Confusing IPv4 and IPv6 rules: the two protocols use different address sizes and conventions.
- Using the result without checking the network plan: routing, VLAN configuration, reserved ranges and security rules may affect how a subnet is used.
Calculation Versus Network Policy
A subnet calculator performs address mathematics. It does not determine whether an IP address is available on your network, whether a route exists, whether a firewall permits traffic, or whether a particular address range is authorized by your organization or provider.
For operational changes, verify the result against the network configuration and applicable policies.
Frequently Asked Questions
What does /24 mean?
It means that the first 24 bits of an IPv4 address form the network prefix. The remaining 8 bits allow 256 addresses in the block.
How many addresses are in a /26 subnet?
A /26 IPv4 subnet contains 64 total addresses. Under the conventional subnet model, 62 are usable for ordinary hosts.
What is the difference between a network address and a broadcast address?
The network address identifies the beginning of an IPv4 subnet. The broadcast address identifies its final address in conventional IPv4 subnetting.
Does a subnet calculator check whether an IP address is available?
No. It calculates address boundaries and related information. Availability must be checked against the actual network configuration.
Are IPv4 and IPv6 subnet calculations the same?
They share the concept of prefix lengths, but IPv4 uses 32-bit addresses and IPv6 uses 128-bit addresses. Their addressing conventions also differ.
Use the Tervilo Subnet Calculator
Use the Tervilo Subnet Calculator to inspect IPv4 subnet boundaries and basic IPv6 prefix information. Review the result alongside your network plan before making configuration changes.
Worked example: 192.168.1.70/26
An IPv4 address has 32 bits. A /26 prefix uses 26 bits for the network, leaving 6 host bits. The block size in the final octet is 26 = 64, so the subnet ranges are 0–63, 64–127, 128–191 and 192–255. The address 192.168.1.70 falls in the 64–127 block: the network address is 192.168.1.64, and the broadcast address is 192.168.1.127. Under conventional IPv4 subnetting, the usable host range is 192.168.1.65 through 192.168.1.126, or 62 addresses.
Host counts and special prefixes
For many conventional IPv4 subnets, the total address count is 2h, where h is the number of host bits. The familiar usable-host formula subtracts the network and broadcast addresses, but special cases such as /31 point-to-point links and /32 single-host routes follow different conventions. Check the intended network use before applying the general formula.
IPv6 is different
IPv6 prefix calculations identify the address prefix and the size of the address block, but IPv6 does not use an IPv4-style broadcast address. Do not apply IPv4 usable-host assumptions to IPv6. Address assignment practices also depend on network architecture and operational requirements.
Subnet validation checklist
- Use a valid IPv4 address with a prefix from
/0through/32, or a valid IPv6 address with a prefix from/0through/128. - Confirm the network address and prefix together, not the IP address alone.
- Check for overlap with existing networks and routing ranges.
- Verify special prefixes and address-use rules before deploying changes.
Limitations
A subnet calculator performs address arithmetic. It does not inspect your routing tables, firewall rules, DHCP scope, or actual network configuration. Validate planned changes in the relevant network documentation and environment.