IPv4 Subnet Mask & CIDR Block Architecture Calculator
Subnet IPv4 addresses: calculate network address, broadcast IP, CIDR subnet mask, and usable host address ranges.
All formulas and computation matrices for this calculator execute directly in your browser with zero latency. Enter your parameters to see instant results.
Who Uses This Calculation & Why Accuracy Matters
Network engineers, systems administrators, cloud architects (AWS VPC, Azure VNet, GCP), and cybersecurity professionals use this calculator to compute IPv4 network boundaries, CIDR prefixes (/0 to /32), subnet masks, broadcast addresses, and usable host address ranges.
A network engineer segmenting a 192.168.10.0/24 Class C space to allocate a dedicated VLAN supporting up to 55 VoIP desktop phones.
A cloud infrastructure engineer deploying an AWS VPC with CIDR 10.100.0.0/16 and dividing it into public and private subnets across multiple availability zones.
A telecommunications engineer provisioning a serial link between two core MPLS edge routers.
IPv4 CIDR Prefix, Subnet Mask & Host Capacity Reference Matrix
Binary prefix lengths, dotted-decimal subnet masks, wildcard masks, and usable host capacities.
| CIDR Prefix | Subnet Mask | Wildcard Mask | Total IP Addresses | Usable Hosts (RFC 791) | Class Equivalent |
|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 Class C |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 1/2 Class C |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 1/4 Class C |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 1/8 Class C |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 1/16 Class C |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 1/32 Class C |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-Point |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 1 Class B |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 1 Class A |
* In standard networks, 2 addresses are reserved per subnet (network address and directed broadcast). In AWS VPCs, 5 addresses are reserved per subnet.
Bitwise IPv4 Subnetting & Host Allocation Mathematics
An IPv4 address consists of 32 bits divided into a network portion and a host portion by the subnet mask. The bitwise logical AND operation between the IP address and the subnet mask yields the Network ID.
Number of leading contiguous 1 bits in the 32-bit subnet mask (0 to 32).
Number of remaining bits allocated to individual host devices.
Bitwise complement (255.255.255.255 minus subnet mask) used in Cisco ACLs.
Step-by-Step Worked Examples with Real Numbers
Subnetting 192.168.1.135 with /27 CIDR Prefix
Point-to-Point Link Allocation (10.0.4.16/30)
Assumptions, Edge Cases & Common Calculation Mistakes
ℹ Underlying Algorithm Assumptions
- Assumes standard Classless Inter-Domain Routing (CIDR) architecture governed by IETF RFC 4632.
- Subtracts 2 addresses for standard subnets (/30 and larger): the first address (network wire ID) and the last address (directed broadcast).
- Assumes unicast IPv4 routing; does not apply to Class D multicast (224.0.0.0/4).
⚠ 3 Common Mistakes to Avoid
- Forgetting that cloud providers like AWS reserve the first 4 and last 1 IP addresses (5 total) in every subnet for VPC router, DNS, and future use.
- Configuring an IP address matching the broadcast address (all host bits 1s) on a host interface, causing address collision errors.
- Overlapping subnet boundaries when expanding existing networks without verifying binary netmask boundaries.
Frequently Asked Questions
What is CIDR notation and why did it replace classful networking?
Classless Inter-Domain Routing (CIDR) replaced the legacy rigid Class A, B, and C system in 1993 (RFC 1519). CIDR allows networks to be partitioned on any arbitrary bit boundary using a prefix length (e.g., /26), drastically reducing global IPv4 routing table exhaustion.
What are the RFC 1918 Private IPv4 address ranges?
RFC 1918 reserves three private address blocks that are not routable on the public Internet: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255), 172.16.0.0/12 (172.16.0.0 to 172.31.255.255), and 192.168.0.0/16 (192.168.0.0 to 192.168.255.255).
Can a /31 subnet be used for point-to-point links?
Yes. RFC 3021 permits /31 subnets (mask 255.255.255.254) on point-to-point links between modern routers. Because there are only two nodes, directed broadcast and network addresses are unnecessary, conserving valuable IPv4 address space.
What is a wildcard mask and where is it used?
A wildcard mask is the bitwise inverse of a subnet mask (e.g., 255.255.255.0 becomes 0.0.0.255). It is used primarily in Cisco IOS Access Control Lists (ACLs) and OSPF routing configurations to match specific ranges of IP addresses.
Why do AWS subnets have 5 fewer usable IP addresses than standard on-premises subnets?
In AWS VPC subnets, Amazon reserves the first four IP addresses (.0 Network, .1 VPC Router, .2 DNS Resolver, .3 Future Use) and the last IP address (.255 Network Broadcast), leaving 251 usable IPs in a /24 subnet rather than 254.