IPv4 & IPv6 Subnet CIDR Calculator
Calculate network address, broadcast, usable host ranges, wildcard masks, and binary bitmasks for IPv4 (/0 to /32) and IPv6 prefix blocks client-side.
100% Secure & Client-Side: Network IP topology and private routing schemes never leave your browser.
Binary Bitmask Decomposition
The Architecture of Classless Inter-Domain Routing (CIDR) and Subnet Masking
In Internet Protocol Version 4 (IPv4), an IP address is a 32-bit unsigned integer typically written in dotted-decimal notation as four 8-bit octets separated by periods (e.g. 192.168.1.1). In the early Internet era (RFC 791, 1981), addresses were organized into rigid "classes" (Class A, B, and C). Class A networks allocated 16 million addresses (/8), Class B allocated 65,536 addresses (/16), and Class C allocated 256 addresses (/24).
Because organizations requiring 500 addresses were forced to take an entire Class B block, the global IPv4 routing table threatened to collapse under massive address exhaustion. In 1993, the IETF standardized Classless Inter-Domain Routing (CIDR) under RFC 1519 (superseded by RFC 4632). CIDR decoupled address allocation from rigid boundaries, permitting arbitrary bitmask lengths from /0 to /32.
Mathematical Logic of Bitwise Subnet Masking
A network router determines whether an incoming packet belongs to a local subnet by performing a bitwise logical AND operation between the destination IP address and the subnet mask:
Network_Address = Destination_IP AND Subnet_MaskFor any prefix length $P$, the number of host bits $H$ equals $32 - P$. The total number of addresses in the block is $2^H$, and the usable host capacity is $(2^H) - 2$.
Complete CIDR Subnet Reference Table
| Prefix | Subnet Mask | Total IP Addresses | Usable Hosts | Typical Deployment |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 (Host route) | Loopback, single device firewall rule |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | Point-to-point router links |
| /30 | 255.255.255.252 | 4 | 2 | Traditional point-to-point router interconnect |
| /29 | 255.255.255.248 | 8 | 6 | Small business public static IP block |
| /28 | 255.255.255.240 | 16 | 14 | Small DMZ or server cluster |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN, AWS VPC subnet, home router |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Corporate VPC root network, university campus |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | IANA Tier 1 regional allocation |
RFC 1918 Private Address Allocations
Certain IP ranges are designated by the IANA exclusively for private intranet usage and cannot be routed across the public Internet:
- 10.0.0.0/8 (10.0.0.0 — 10.255.255.255): 16,777,216 addresses, commonly deployed in enterprise intranets and cloud VPCs.
- 172.16.0.0/12 (172.16.0.0 — 172.31.255.255): 1,048,576 addresses, frequently used for container orchestration (Docker bridge networks, Kubernetes pods).
- 192.168.0.0/16 (192.168.0.0 — 192.168.255.255): 65,536 addresses, standard default for residential Wi-Fi gateways and SOHO routers.
- 127.0.0.0/8: Loopback interfaces (localhost).
- 169.254.0.0/16: Automatic Private IP Addressing (APIPA / Link-Local) when DHCP servers are unreachable.