Why subnet calculations matter for network design
Every device on a network needs an IP address within the correct subnet range, and getting that range wrong means devices cannot communicate, DHCP pools hand out invalid addresses, or firewall rules block legitimate traffic. Subnetting divides a large network into smaller, manageable segments — each with its own network address, broadcast address, and usable host range. Whether you are setting up a home lab with a `/24`, carving out VLANs in a corporate network, or studying for a networking certification, the ability to derive all subnet properties from an IP and prefix length is a fundamental skill.
The math behind it is straightforward in principle — bitwise AND the IP address with the subnet mask to get the network address, flip the host bits for the broadcast, and count the remaining host bits to determine usable addresses. In practice, doing this in binary for anything beyond a `/24` is tedious and error-prone. A calculator that handles both IPv4 and IPv6, including special cases like `/31` and `/32`, eliminates the manual arithmetic and lets you focus on network design decisions.
All computation is performed locally in your browser. No IP addresses or network information is transmitted anywhere.
IPv4 subnet output fields
| Field | Description | Example (192.168.1.100/24) |
|---|---|---|
| Network address | Bitwise AND of IP and mask | 192.168.1.0 |
| Broadcast address | All host bits set to 1 | 192.168.1.255 |
| Subnet mask | Prefix bits as 1, host bits as 0 | 255.255.255.0 |
| Wildcard mask | Inverse of the subnet mask | 0.0.0.255 |
| First usable host | Network address + 1 | 192.168.1.1 |
| Last usable host | Broadcast address - 1 | 192.168.1.254 |
| Usable hosts | 2^(32 - prefix) - 2 | 254 |
| IP class | A, B, or C based on first octet | C |
How to calculate a subnet
Choose IPv4 or IPv6 depending on the address type you are working with
Enter the IP address and the CIDR prefix length (for example, 192.168.1.0/24)
Click Calculate to see the full subnet breakdown
Click any result value to copy it to your clipboard
How to verify the calculation
Test with a well-known subnet: enter 10.0.0.0/24 and confirm the network address is 10.0.0.0, the broadcast is 10.0.0.255, the subnet mask is 255.255.255.0, and the usable host range is 10.0.0.1 through 10.0.0.254. Then test a `/31` — enter 192.168.1.0/31 and verify it shows 2 addresses with no broadcast, which is the RFC 3021 point-to-point link behavior. For IPv6, enter 2001:db8::/32 and confirm the total address count and network prefix are correct.
Common mistakes in subnet calculation
Counting the network and broadcast addresses as usable hosts — a /24 has 256 total addresses but only 254 usable ones
Applying the classful subnet mask instead of the CIDR prefix — 192.168.1.100 is class C, but /23 is valid and produces a different mask than the default /24
Forgetting that /31 is a special case with 2 usable hosts and no broadcast address per RFC 3021
Mixing up wildcard masks (used in ACLs) with subnet masks — the wildcard is the bitwise inverse
Edge cases and special prefixes
A /32 represents a single host with no network or broadcast — useful for loopback addresses and host routes in routing tables. A /31 supports exactly two addresses and is designated for point-to-point links, skipping the traditional network and broadcast reservation. On the IPv6 side, a /128 is the equivalent of a single host, and very small prefixes like /120 are sometimes used for point-to-point IPv6 links. The calculator handles all of these without error, but understanding their special semantics is important for correct network configuration.
Who uses an IP subnet calculator
Network engineers designing VLANs and assigning address ranges across a corporate infrastructure
Students preparing for CCNA, CompTIA Network+, or similar certification exams
System administrators configuring server interfaces, firewall rules, and DHCP scopes
Cloud architects planning VPC subnets across availability zones
Frequently asked questions
Q: Which calculations are performed for IPv4?
A: Network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total usable host count, and IP class — all derived from bitwise operations on the IP and prefix length.
Q: What does the calculator show for IPv6?
A: It expands the full address, shows the compressed zero-run shorthand, displays the CIDR notation, calculates the total number of addresses in the subnet, and shows the network prefix.
Q: Does it support /31 and /32 prefixes?
A: Yes. A /31 is treated as a point-to-point link with 2 addresses and no broadcast, per RFC 3021. A /32 represents a single host with no network or broadcast address.
Q: Is my IP address uploaded?
A: No. All subnet calculation happens entirely in your browser. No data is sent to any server.
Q: What is a wildcard mask?
A: The wildcard mask is the bitwise inverse of the subnet mask. It is used in access control lists (ACLs) on Cisco routers and some firewall configurations. For a /24 (mask 255.255.255.0), the wildcard is 0.0.0.255.
Q: Can I calculate supernetting (aggregation)?
A: The calculator shows details for a single CIDR prefix. For supernetting multiple subnets into one, you would need to determine the common prefix length manually and then enter the aggregated address.
Calculate your subnet now
Get the full subnet breakdown with the IP Subnet Calculator. For web development reference, browse the HTTP Status Codes Reference, or encode special characters with URL Encode / Decode. Generate unique identifiers with the UUID Generator or format API responses using the JSON Formatter.