About the Subnet Calculator
This IPv4 subnet calculator takes a CIDR address such as 192.168.1.10/24 and computes everything you need to understand the block it belongs to: the network address, broadcast address, netmask, wildcard mask, the usable host range and both the usable and total host counts. It is a quick reference for planning a network, sizing a subnet before requesting an allocation, or building a router or firewall rule that needs a wildcard mask.
You reach for it when subnetting a VLAN or office network, checking whether a candidate IP address actually falls inside a proposed range, working out an ACL or OSPF wildcard mask by hand would otherwise be tedious, or simply confirming how many usable addresses a given prefix length actually gives you before committing to it.
What sets it apart from doing the arithmetic yourself is that it handles the edge cases correctly by default: a prefix is optional and defaults to /24 if you omit it, and /31 and /32 networks are treated as the special point-to-point and host-route cases they are under RFC 3021, rather than blindly subtracting two reserved addresses the way a naive calculation would.
The calculation is pure arithmetic and runs entirely in your browser, no address or network detail is sent to a server at any point. That matters here specifically because subnet planning very often involves internal, private address ranges you would not want transmitted anywhere, this tool never gives you a reason to worry about that.
How to use it
- Enter an IPv4 address with a CIDR prefix, for example 10.0.0.5/22, or omit the prefix to default to /24.
- Read the computed network and broadcast addresses first, they define the block's outer boundaries.
- Check the netmask, and the wildcard mask if you're building a router ACL or OSPF network statement.
- Use the usable host range and host count to plan IP assignments within the block.
- Compare the usable count against the total address count for small prefixes (/30, /31, /32) where the difference matters most.
- Adjust the prefix length to see live how the block grows or shrinks.
- Confirm a specific candidate IP actually falls inside the computed host range before assigning it.
Examples
- 192.168.1.10/24 gives network 192.168.1.0, broadcast 192.168.1.255, netmask 255.255.255.0, usable range 192.168.1.1 to 192.168.1.254, 254 hosts.
- 10.0.0.0/30 gives a usable range of just 10.0.0.1 to 10.0.0.2, 2 hosts, the classic size for a point-to-point router link.
- 172.16.0.0/16 gives a wildcard mask of 0.0.255.255 for an ACL rule, covering 65,534 usable hosts.
- 192.168.1.0/27 gives a usable range of 192.168.1.1 to 192.168.1.30, 30 hosts, a common size for a single office floor or VLAN.
- 10.10.10.0/31 gives both addresses in the pair as usable, RFC 3021's point-to-point exception, no network or broadcast address is reserved.
- 203.0.113.5/32 gives exactly 1 usable address, itself, a host route rather than a network.
CIDR prefix to usable host count, quick reference
The relationship between prefix length and usable hosts is exponential, not linear, so it helps to have the common sizes memorised or at hand rather than recalculated each time.
- /8: 16,777,214 usable hosts.
- /16: 65,534 usable hosts.
- /22: 1,022 usable hosts.
- /24: 254 usable hosts, the default this tool assumes when no prefix is given.
- /25: 126 usable hosts.
- /26: 62 usable hosts.
- /27: 30 usable hosts.
- /28: 14 usable hosts.
- /29: 6 usable hosts.
- /30: 2 usable hosts, the traditional minimum for a point-to-point link.
- /31: 2 usable hosts, but both addresses of the pair, network and broadcast are not reserved (RFC 3021).
- /32: 1 usable host, a route to a single address rather than a network.
Netmask versus wildcard mask
A netmask, like 255.255.255.0, marks which bits of an address belong to the network portion, a 1 bit means "this bit is fixed for the network". A wildcard mask is its bitwise inverse, 0.0.0.255 for the same /24, and is what Cisco-style ACLs and OSPF network statements expect instead of a netmask; a 1 bit there means "this bit can vary", the opposite convention. Getting the two confused is one of the most common causes of an ACL that matches the wrong addresses or an OSPF network statement that silently includes or excludes more than intended.
Why /31 and /32 are special cases
Classic subnetting reserves the first address of a block as the network address and the last as the broadcast address, leaving both unusable for hosts, which is why a /30 with 4 total addresses only offers 2 usable ones. RFC 3021 carves out an explicit exception for /31: on a point-to-point link there is no need for a broadcast address at all, so both addresses in the pair are usable, doubling the efficiency of the smallest practical link subnet, a pattern common in ISP and router-to-router configurations. A /32 goes further still and describes a route to exactly one address, commonly used for loopback interfaces, individual host routes, or as the address format for a single advertised prefix in routing protocols.
Common subnetting mistakes
Most subnetting errors come from applying rules that stopped being universally true once classful addressing gave way to CIDR and VLSM.
- Forgetting that any block /30 or larger reserves its first and last address, so total addresses always overstate what you can actually assign.
- Treating a /24 as if it always means a historical "Class C", CIDR and VLSM let any prefix length apply to any address range.
- Assuming you can shrink or grow a prefix in place without renumbering hosts already assigned inside it.
- Computing a wildcard mask by subtracting each octet from 255 by hand instead of simply inverting the netmask bit for bit, easy to get wrong on non-octet-aligned prefixes.
- Overlooking that a /31 is a deliberate, valid exception rather than a mistake, some tools and engineers still flag it as invalid out of habit.
Frequently asked questions
What is a CIDR subnet calculator?
It is a tool that converts an address-plus-prefix like 192.168.1.0/24 into the block's actual boundaries: network and broadcast addresses, netmask, wildcard mask, host range and host count.
How is the usable host count calculated?
For a standard IPv4 subnet it is 2 to the power of (32 minus the prefix), minus 2, because the network and broadcast addresses are reserved. A /24 gives 254 usable hosts. /31 and /32 are handled as special cases instead.
What is the difference between a netmask and a wildcard mask?
A netmask (e.g. 255.255.255.0) marks the network bits directly. The wildcard mask is its bitwise inverse (0.0.0.255), the format expected by router ACLs and OSPF network statements instead of a netmask.
Why do /31 and /32 subnets behave differently from a /30?
A /30 reserves a network and broadcast address, leaving 2 usable out of 4. A /31 is a special RFC 3021 case for point-to-point links where both addresses are usable, and a /32 is a single host route with exactly 1 usable address.
Does this network calculator send my addresses to a server?
No. The subnet math runs entirely client-side in your browser, so the address you enter, often part of an internal or private network layout, never leaves your device.
Can it calculate IPv6 subnets?
This tool focuses on IPv4 CIDR arithmetic. IPv6's 128-bit address space and different subnetting conventions are outside its current scope.
What happens if I don't specify a prefix length?
The tool assumes a /24, the same as entering 192.168.1.10/24 explicitly for the address 192.168.1.10.
How do I check whether a specific IP falls inside a subnet?
Enter the network's address and prefix, then compare the candidate IP against the computed host range shown. If it falls between the first and last usable addresses, it belongs to that subnet.
Why doesn't a /24 always mean exactly 256 usable addresses?
A /24 has 256 total addresses, but the first (network) and last (broadcast) are reserved on any subnet /30 or larger, leaving 254 usable, a distinction this calculator always applies automatically.