Subnet Calculator — Calculate IPv4 Subnets and CIDR Ranges Instantly
Subnetting is a core skill for network engineers, IT administrators, and anyone designing or troubleshooting IP networks, but the binary arithmetic behind it is tedious and error-prone. Our free subnet calculator lets you enter an IP address and a CIDR prefix length (for example, 192.168.1.1 and /24) to instantly compute the network address, broadcast address, subnet mask, wildcard mask, the range of usable host addresses, and the total number of usable hosts. Whether you are planning a network segment, assigning an IP range to a department, or debugging why two devices cannot talk to each other, this tool gives you the full subnet picture in seconds. Enter your IP and CIDR prefix above to compute the subnet details.
How CIDR and Subnet Masks Work
An IPv4 address is 32 bits, and CIDR notation (Classless Inter-Domain Routing) expresses how many of those bits identify the network versus the host. A /24 prefix means the first 24 bits are the network portion and the last 8 bits are the host portion, giving 256 total addresses (254 usable after subtracting the network and broadcast addresses). The subnet mask is derived directly from the prefix: /24 produces a mask of 255.255.255.0, /16 produces 255.255.0.0, and so on. Smaller prefixes (larger numbers, like /30) create smaller subnets with fewer hosts, useful for point-to-point links, while larger prefixes (smaller numbers, like /8) create vast networks. The calculator handles any prefix from /0 to /32 and correctly computes the network and broadcast addresses by applying the mask with bitwise operations.
Network, Broadcast, and Usable Hosts
Within any subnet, two addresses are reserved and cannot be assigned to hosts. The network address is the lowest address in the range, where all host bits are zero; it identifies the subnet itself. The broadcast address is the highest address, where all host bits are one; it is used to send a packet to every host in the subnet. The usable host range is everything in between. For a /24 subnet, that leaves 254 usable hosts (256 minus the network and broadcast). For a /30 subnet, only 2 usable hosts remain — which is why /30 links are common for router-to-router connections where you only need two addresses. The calculator extracts and displays the network address, broadcast address, subnet mask, wildcard mask (the bitwise inverse of the mask, used in ACLs), the first and last usable host, and the total usable host count, so you have everything a network design requires in one view.
Practical Uses for a Subnet Calculator
When planning a network, the calculator helps you size subnets to the number of hosts you need. A small office with 30 devices fits comfortably in a /27 (30 usable hosts) or /26 (62 usable hosts), while a larger floor might need a /25 or /24. For point-to-point router links, /30 is standard. When troubleshooting, the calculator confirms whether two IP addresses fall in the same subnet — if their network address (computed with the same mask) matches, they can communicate directly; if not, traffic must route through a gateway. When designing access control lists, the wildcard mask the calculator produces tells you exactly what to enter in a Cisco-style ACL. And when carving a larger block into smaller subnets — for example, splitting a /24 into four /26s — the calculator confirms the boundaries of each child subnet so you avoid overlaps.
Subnetting Tips and Common Mistakes
The most common subnetting mistake is miscalculating the network and broadcast addresses for non-byte-aligned prefixes such as /22, /23, or /26, where the boundary does not fall neatly on an octet. The calculator removes this risk by computing addresses directly from the binary. When dividing a larger block, remember that subnet boundaries must align to powers of two — you cannot carve an arbitrary range out of the middle of a subnet without splitting it into properly aligned pieces. Plan for growth: a subnet sized exactly to current need may force a painful re-addressing later when the team grows, so leave headroom where the address space allows. Finally, document your subnet plan in writing; the calculator gives you the numbers, but a written record of which subnet serves which purpose is what keeps a network maintainable over time.
Frequently Asked Questions
Does the calculator support IPv6? This tool focuses on IPv4. IPv6 subnetting uses a 128-bit address and a different convention; a separate IPv6 calculator would be needed for that.
What is the wildcard mask for? The wildcard mask is the bitwise inverse of the subnet mask and is used in access control lists (ACLs), particularly on Cisco equipment, to match ranges of addresses.
Why does a /31 show 2 hosts? RFC 3021 permits /31 point-to-point links with two usable addresses (no dedicated broadcast). The calculator reflects this special case for /31 prefixes.
Bookmark this subnet calculator to compute subnet boundaries accurately whenever you design, assign, or troubleshoot IP networks.