IP Subnet Calculator
Calculate the network address, broadcast address, usable host range and subnet mask for an IPv4 address and CIDR prefix.
Tool guide
What this tool does
IP Subnet Calculator computes the network address, broadcast address, first/last usable host, subnet mask, wildcard mask and total/usable host counts for any IPv4 address and CIDR prefix length (/0 to /32), including correct /31 point-to-point and /32 host-route handling.
Subnetting, dividing a network into smaller address blocks, is one of those networking skills that’s simple in concept but genuinely fiddly to compute correctly by hand, especially the usable host range and wildcard mask, without a mistake creeping in.
This calculator takes any IPv4 address and CIDR prefix length and computes every related value: the network address, broadcast address, first and last usable host, subnet and wildcard masks, and total versus usable host counts, including the special-case handling /31 (point-to-point links, RFC 3021) and /32 (a single host route) need.
How to use IP Subnet Calculator
- Enter an IP Address within the subnet you want to analyse.
- Set the Prefix length (CIDR), the number after the / in notation like /24.
- Review the Network address, Broadcast address and usable host range.
- Check Subnet mask and Wildcard mask for firewall/ACL configuration.
Tips for better results
- A /24 subnet mask is 255.255.255.0 and holds 256 total addresses (254 usable); each step down by 1 (e.g. /23) doubles the address space, each step up (e.g. /25) halves it.
- The wildcard mask is the bitwise inverse of the subnet mask, used by Cisco ACLs and OSPF configuration instead of a regular subnet mask.
- /31 subnets are a documented exception (RFC 3021): both addresses are usable, intended for point-to-point links where a separate network/broadcast address would waste half the available addresses.
- A /32 is a single host route, both the network and usable address are the same single IP, commonly used for loopback addresses or very specific routing rules.
Common use cases
- Planning IP address allocation when designing or documenting a network.
- Determining the usable host range for a given subnet before assigning static IPs.
- Converting between CIDR notation and dotted-decimal subnet masks for firewall or router configuration.
- Checking whether two IP addresses fall within the same subnet.
Common mistakes to avoid
- Forgetting that the network and broadcast addresses aren’t usable for hosts in a normal subnet (everything except /31 and /32), reducing the usable count by exactly 2 from the total.
- Confusing the subnet mask with the wildcard mask, they’re bitwise inverses of each other and used in different contexts (subnet masks for addressing, wildcard masks for Cisco ACLs/OSPF).
- Assuming the historical IP "class" (A/B/C) still determines subnet size; modern networking uses CIDR exclusively, and the class shown here is purely informational/historical context.
Frequently asked questions
Why does a /24 have only 254 usable hosts, not 256?
The first address in the range is reserved as the network address and the last as the broadcast address, neither is assignable to a host, leaving 256 − 2 = 254 usable addresses.
What’s special about /31 and /32?
/31 (RFC 3021) is a documented exception where both addresses in the 2-address range are usable, designed for point-to-point links; /32 is a single-address host route where that one address is both the network and the only usable address.
What is a wildcard mask used for?
It’s the bitwise inverse of a subnet mask, used instead of a regular mask in Cisco access control lists (ACLs) and OSPF routing configuration.
Does the IP "class" shown still matter?
No, classful addressing (A/B/C/D/E) was superseded by CIDR decades ago; it’s shown purely as historical context, modern routing and subnetting decisions are based entirely on the prefix length, not the class.
Feedback & suggestions
Help us improve IP Subnet Calculator. We read every message.