Subnet Calculator
Calculate IP ranges, subnet masks, and host counts from CIDR notation
About This Tool
Derives network address, broadcast address, usable host range, host count, and wildcard mask from a CIDR block such as 192.168.1.0/24. Supports IPv4 and IPv6. Reverse calculation accepts a dotted-decimal IP and subnet mask and returns the equivalent CIDR notation, useful when migrating from legacy network documentation.
IPv4 calculations follow RFC 950. /31 networks (RFC 3021) are recognized for point-to-point links; /32 represents a single host route.
The mathematical basis is bitwise. A /n CIDR block fixes the first n bits as the network identifier and uses the remaining 32-n (IPv4) or 128-n (IPv6) bits for host enumeration. Network address has all host bits zero; broadcast address has all host bits one. Usable host count is 2^(32-n) minus 2 in IPv4 (subtracting network and broadcast), with the special exceptions for /31 and /32. The wildcard mask is the bitwise complement of the subnet mask.
A worked example for 192.168.1.0/24: subnet mask 255.255.255.0 (binary: 24 ones followed by 8 zeros). Network address 192.168.1.0. Broadcast address 192.168.1.255. Usable host range 192.168.1.1 through 192.168.1.254. Host count 254. Wildcard mask 0.0.0.255. Total addresses 256. Class C historical equivalent. Adjacent /24 networks: 192.168.0.0/24 below, 192.168.2.0/24 above.
Subnetting splits a larger block into smaller equal-sized blocks. /24 split into four /26 blocks yields 192.168.1.0/26 (hosts .1 through .62), 192.168.1.64/26 (hosts .65 through .126), 192.168.1.128/26 (hosts .129 through .190), 192.168.1.192/26 (hosts .193 through .254). Each /26 has 64 total addresses, 62 usable. VLSM (variable-length subnet masking) allows mixed sizes within a single block, useful when subnet host counts vary.
IPv6 calculation differs in scale and convention. The minimum recommended subnet is /64, holding 1.8 × 10^19 addresses. Site allocations are typically /48 or /56, producing thousands of /64 subnets per allocation. Stateless address autoconfiguration (SLAAC) requires /64 boundaries; using a smaller subnet breaks SLAAC and forces DHCPv6. Hex notation and double-colon compression complicate parsing; the calculator expands shortened forms before processing.
Limitations: the calculator works with addresses, not topology. It cannot detect overlapping subnets, route conflicts, or actual reachability. RFC 1918 private ranges are flagged but not enforced; the calculator will compute parameters for any block including reserved or invalid ranges. Production network design requires IPAM (IP address management) software for tracking allocations and conflicts; the calculator handles single-block analysis only.
The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.