IPv4 & IPv6 CIDR Subnet Calculator
Compute exact network boundaries, netmasks, wildcard masks, usable host ranges, and binary bitmasks instantaneously using client-side BigInt math.
CIDR Network Boundaries
Masks & Capacity
Binary Bitmask & Address Breakdown
—
CIDR Masking, VLSM & IPv6 Prefix Design
Classless Inter-Domain Routing (CIDR) & VLSM
Replaced legacy Class A/B/C boundaries (RFC 4632). A prefix length /n fixes the leading n network bits of a 32-bit IPv4 or 128-bit IPv6 address and assigns the remaining host bits cleanly:
- Variable Length Subnet Masking (VLSM): slice one cloud VPC (
10.0.0.0/16) into/24application subnets,/27bastion subnets, and/31router links without wasting space. - Special Host Exceptions: standard subnets reserve
network+broadcast(2^(32-n) - 2hosts), whereas RFC 3021/31links use both IPs and/32is a loopback or host route. - Reserved Ranges: RFC 1918 private blocks (
10/8,172.16/12,192.168/16) and CGNAT (100.64/10) are non-routable on the public internet.
IPv6 Allocation Boundaries (/48, /56, /64)
IPv6 eliminates tight address conservation in favor of fixed hexadecimal boundaries on 4-bit nibbles:
/48Site Assignment: enterprise campus or ISP business allocation giving65,536individual/64VLANs./56Broadband Customer: standard home gateway delegation offering256separate/64subnets for guest, IoT, and LAN isolation./64LAN Subnet: universal minimum SLAAC (RFC 4862) broadcast domain — verify your active prefix live using our IPv6 Dual-Stack Test or IP WHOIS.
Complete IPv4 & IPv6 CIDR Cheat Sheet
| CIDR | Subnet Mask | Wildcard Mask | Total Addresses | Usable Hosts | Common Allocation Role |
|---|---|---|---|---|---|
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Loopback, BGP host route, single firewall ACL |
/31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (RFC 3021) | Point-to-point router interconnect |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Legacy point-to-point link |
/29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Small business static fiber block |
/28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Cloud subnet / dedicated hosting rack |
/27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Small office LAN or DMZ segment |
/26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Department VLAN or NAT pool |
/25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Half of a legacy Class C block |
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Minimum globally routable IPv4 BGP prefix |
/22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Campus or broadband access gateway pool |
/20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Regional ISP customer pool or cloud AZ slice |
/16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Cloud VPC default CIDR / RIR end-user allocation |
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | RFC 1918 10.0.0.0/8 private space / legacy allocation |
/48 (IPv6) | 48 network bits | — | 2^80 | 65,536 /64s | Standard enterprise site & BGP minimum IPv6 route |
/56 (IPv6) | 56 network bits | — | 2^72 | 256 /64s | Typical residential FTTH/cable CPE delegation |
/64 (IPv6) | 64 network bits | — | 2^64 | SLAAC LAN | Standard single IPv6 LAN subnet |
IPv4 CIDR Reference Table & Special-Use Reserved Ranges (IANA / RFC)
Quick engineering cheat sheet mapping common CIDR prefix lengths to subnet masks, wildcard masks for Cisco/ACL rules, usable host counts, and IANA special-purpose blocks:
IPv4 CIDR Subnet Mask & Capacity Reference
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts | Common Network Role |
|---|---|---|---|---|---|
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | Historical Class A / RIR legacy allocations |
/16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Large university, enterprise campus, or VPC supernet |
/20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Regional ISP broadband aggregation pool |
/22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Minimum ARIN/RIPE/APNIC IPv4 member delegation |
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Smallest prefix universally accepted in global BGP tables |
/27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Branch office LAN, small Kubernetes node subnet |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Legacy point-to-point router interconnect (4 IPs total) |
/31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | Modern RFC 3021 point-to-point link (zero wasted broadcast) |
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host route, BGP loopback, or firewall allowlist entry |
Special-Use & Reserved IPv4 Blocks (IANA / RFC)
| Reserved CIDR | Addresses | RFC | Scope & Operational Purpose |
|---|---|---|---|
10.0.0.0/8 | 16,777,216 | RFC 1918 | Private internal corporate, VPC, and datacenter networks (non-routable) |
100.64.0.0/10 | 4,194,304 | RFC 6598 | Shared Address Space used for ISP & mobile Carrier-Grade NAT (CGNAT) |
127.0.0.0/8 | 16,777,216 | RFC 1122 | Local host loopback interface traffic (127.0.0.1 default) |
169.254.0.0/16 | 65,536 | RFC 3927 | Link-local APIPA & cloud instance metadata endpoints (169.254.169.254) |
172.16.0.0/12 | 1,048,576 | RFC 1918 | Private internal networks and default container bridge ranges (172.16–172.31) |
192.0.2.0/24 | 256 | RFC 5737 | TEST-NET-1 documentation prefix for code examples and guides |
192.168.0.0/16 | 65,536 | RFC 1918 | Private home router, SMB LAN, and guest Wi-Fi DHCP pools |
198.18.0.0/15 | 131,072 | RFC 2544 | Inter-network device benchmarking & lab stress testing |
224.0.0.0/4 | 268,435,456 | RFC 5771 | IPv4 Multicast routing group range (224.0.0.0–239.255.255.255) |
Frequently Asked Questions
How many usable IPv4 addresses are in a /24 or /22 subnet?
A /24 CIDR block contains 256 total IPv4 addresses (254 usable host IPs after reserving the network ID and broadcast address). A /22 contains 1,024 addresses (1,022 usable hosts).
What is the difference between a /31 link subnet and larger IPv4 subnets?
Under RFC 3021, /31 subnets eliminate network and broadcast reservations so both addresses serve directly on router-to-router point-to-point links, saving half the IPv4 space compared to /30.
What is a wildcard mask and where is it used?
A wildcard mask is the bitwise complement of the subnet mask (255.255.255.0 becomes 0.0.0.255). Router OSPF network statements and switch ACLs use 0 bits for exact matching and 1 bits for don't-care bits.
Why is /24 the smallest prefix announced on public BGP?
Global transit networks filter IPv4 prefixes longer than /24 (and IPv6 longer than /48) to prevent route explosion across core router TCAM tables.
Why do IPv6 LANs almost universally use /64?
IPv6 SLAAC (RFC 4862) mandates a 64-bit host interface identifier. Subdividing a LAN smaller than /64 breaks stateless autoconfiguration, neighbor discovery security assumptions, and mobile OS tethering.