Subnet Calculator — Free CIDR/IPv4 Range & Host Calc
Calculate IPv4 subnets from CIDR. Get network address, broadcast, host range, subnet mask, and wildcard mask. 100% browser-based — no data sent to any server.
Features
- ✓Calculate network address, broadcast address, and usable host range from any IPv4 CIDR notation
- ✓Compare two subnets to detect overlap, containment, or complete separation
- ✓VLSM (Variable Length Subnet Mask) calculator — split a network into subnets of different sizes
- ✓Instant subnet mask and wildcard mask generation for prefix lengths /0 through /32
- ✓Binary representation display for both IP address and subnet mask to visualize bit boundaries
- ✓Built-in CIDR reference table showing all 33 prefix lengths with their subnet masks and host capacities
- ✓IPv4 network class detection (Class A, B, C, D, E) and private IP range identification (RFC 1918)
- ✓Support for all standard subnet sizes from /32 (single host) to /0 (entire IPv4 space)
- ✓Handles edge cases like /31 (point-to-point) and /32 (single host) correctly
- ✓All calculations run entirely in your browser — no data sent to any server
- ✓Copy any calculated field — network address, broadcast address, usable range, subnet mask, or the entire result table — individually to clipboard with one click
- ✓Visual binary breakdown — see the IP address and subnet mask side by side in binary format with the network/host boundary clearly marked for educational purposes
How to Use
- 1Enter an IPv4 address and CIDR prefix to calculate network details.
- 2Switch to the Compare tab to check if two subnets overlap, contain each other, or are separate.
- 3Switch to the VLSM tab to split a network block into multiple subnets of different sizes.
- 4In VLSM mode, add subnet requirements with names and required host counts, then click Calculate.
- 5Review the results: allocated subnets, remaining space, and any wasted addresses.
- 6Use the CIDR reference table below to look up common prefix lengths and their host capacities.
- 7Use the binary representation view to understand how the subnet mask separates the network and host portions — helpful for CCNA/network exam preparation
- 8Export the subnet plan as formatted text after VLSM calculation — copy the allocation table to document your network design for team review
Frequently Asked Questions
What is CIDR notation and how does it work?
∨
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its subnet prefix length using the format IP/prefix (e.g., 192.168.1.0/24). The prefix length indicates how many bits of the address are the network portion. The remaining bits identify hosts within that network. /24 means the first 24 bits are the network, leaving 8 bits (256 addresses) for hosts.
Why does a /24 subnet have 254 usable hosts instead of 256?
∨
In every subnet, two addresses are reserved: the network address (all host bits set to 0) and the broadcast address (all host bits set to 1). For a /24 network, 256 - 2 = 254 usable addresses. The exception is /31 (2 addresses = point-to-point link, no broadcast needed) and /32 (1 address = single host).
What is the difference between total hosts and usable hosts?
∨
Total hosts is the number of all IP addresses in the subnet (2^(32 - prefix)). Usable hosts excludes the network address and broadcast address, leaving addresses assignable to devices. For /31 and /32, all addresses are usable.
What are private IP ranges and why do they matter?
∨
Private IP ranges (RFC 1918) are reserved for internal networks and are not routable on the public internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. The tool automatically flags when an IP falls in a private range.
What does the subnet comparison tool do?
∨
The compare feature takes two CIDR notations and determines their relationship: identical (same range), contains (one fully encloses the other), overlap (partially shared), or separate (no address overlap). This is useful for checking if a new subnet conflicts with existing allocations in your network.
How does the VLSM calculator work?
∨
VLSM (Variable Length Subnet Masking) divides a network block into subnets of different sizes to minimize waste. Enter your base CIDR block (e.g., 192.168.1.0/24) and add requirements with names and needed host counts. The tool sorts requirements largest-first, finds the smallest prefix that fits each, aligns to network boundaries, and allocates sequentially. Remaining space is reported at the end.
What is a wildcard mask used for?
∨
A wildcard mask is the inverse of a subnet mask. It is used in ACLs and routing protocols like OSPF and EIGRP to specify which bits should be matched (0) or ignored (1). For example, 0.0.0.255 matches any host in a /24 network.
Is my IP data sent to any server?
∨
No. All subnet calculations, comparisons, and VLSM splits happen entirely in your browser using JavaScript. Your IP data never leaves your device. The tool works offline after the page loads.
How do I calculate how many hosts a subnet can support?
∨
The number of usable hosts in a subnet is 2^(32 - prefix) - 2. For example: /24 gives 2^8 - 2 = 254 usable hosts, /28 gives 2^4 - 2 = 14 usable hosts, /30 gives 2^2 - 2 = 2 usable hosts (point-to-point). The tool automatically calculates this for any CIDR you enter. Remember to subtract 2 for network and broadcast addresses, except for /31 (2 usable, no broadcast) and /32 (1 usable, single host).
What is the difference between subnetting and VLSM?
∨
Traditional subnetting (classful) divides a network into equal-sized subnets using the same prefix length, which wastes addresses when different subnets need different numbers of hosts. VLSM (Variable Length Subnet Mask) divides a network into subnets of different sizes, allocating exactly the number of addresses each subnet needs. VLSM is the modern standard and is used by real-world network designs. The tool's VLSM calculator automatically sorts requirements by size and allocates the most efficient subnets.
Related Tools
IP Address Lookup — Free Geolocation, ISP & ASN Info
Find geolocation, ISP and ASN for any IP address. Free IP lookup tool with city-level location, timezone and map coordinates. Browser-based privacy.
DNS Lookup — Free All 16 Record Types (A, AAAA, MX, SRV)
Free DNS lookup supporting 16 record types (A, AAAA, MX, SRV, HTTPS, etc.) via Cloudflare, Google, or AliDNS DoH. All queries run in your browser — no server.