CIDR Subnet Calculator

Free online CIDR subnet calculator for IPv4. Calculate subnet masks, network addresses, broadcast IPs, usable host ranges, binary masks, and visual subnet partitions.

CIDR IPv4 Subnet Calculator Mask and IP Address Range Tool

Usable Host Range

192.168.1.1 – 192.168.1.254

254 usable host IPs

Subnet Mask

255.255.255.0

Wildcard: 0.0.0.255

Network Address

192.168.1.0

Broadcast IP: 192.168.1.255

Network Scope

Private (Class C - RFC 1918)

Total IP block size: 256

Subnet Configuration

/24

Subnet Partition Preview (4 × /26)

Dividing this /24 into 4 equal child subnets for multi-zone cloud architecture:

192.168.1.0/26Subnet #1
Range: 192.168.1.1 - 192.168.1.62
62 usable hosts
192.168.1.64/26Subnet #2
Range: 192.168.1.65 - 192.168.1.126
62 usable hosts
192.168.1.128/26Subnet #3
Range: 192.168.1.129 - 192.168.1.190
62 usable hosts
192.168.1.192/26Subnet #4
Range: 192.168.1.193 - 192.168.1.254
62 usable hosts

Quick Answer: How to Calculate Usable Hosts in a CIDR Subnet

To calculate the number of usable hosts in an IPv4 CIDR block, use the formula 2^(32 - CIDR) - 2. For a /24 subnet, the calculation is 2^(32 - 24) - 2 = 2^8 - 2 = 254 usable hosts (with a subnet mask of 255.255.255.0). The first address (.0) is reserved for the network, and the last address (.255) is reserved for broadcast traffic.

Visual IPv4 32-Bit Binary Structure

An IPv4 address consists of 32 bits partitioned into Network Bits (routing prefix) and Host Bits (individual machines):

Current Subnet: 192.168.1.0/2424 Network Bits | 8 Host Bits
Network Binary:11000000.10101000.00000001.00000000
Netmask Binary:11111111.11111111.11111111.00000000

CIDR Prefix Reference Table (/16 to /30)

CIDR PrefixSubnet MaskTotal IPsUsable Hosts (RFC)AWS VPC Usable
/16255.255.0.065,53665,53465,531
/20255.255.240.04,0964,0944,091
/24255.255.255.0256254251
/26255.255.255.192646259
/28255.255.255.240161411
/30255.255.255.252420 (Too small for VPC)

Step-by-Step Case Study: Designing an AWS Multi-AZ VPC

Let's design a production-grade AWS VPC subnet topology starting from a primary parent block of 10.0.0.0/16:

  1. Public Web Subnets (/24 = 251 usable IPs each):
    10.0.1.0/24 in us-east-1a (Public NAT / ALB load balancers)
    10.0.2.0/24 in us-east-1b (Public NAT / ALB load balancers)
  2. Private Application Subnets (/22 = 1,019 usable IPs each):
    10.0.4.0/22 in us-east-1a (Kubernetes EKS worker nodes / microservices)
    10.0.8.0/22 in us-east-1b (Kubernetes EKS worker nodes / microservices)
  3. Isolated Database Subnets (/26 = 59 usable IPs each):
    10.0.16.0/26 in us-east-1a (Amazon Aurora PostgreSQL Primary)
    10.0.16.64/26 in us-east-1b (Amazon Aurora PostgreSQL Read Replica)

RFC 1918 Private IP Ranges Reference

  • 10.0.0.0/8: 10.0.0.0 to 10.255.255.255 (16,777,216 total addresses - standard for massive corporate datacenters & AWS VPCs).
  • 172.16.0.0/12: 172.16.0.0 to 172.31.255.255 (1,048,576 total addresses - common default in Docker bridge networks).
  • 192.168.0.0/16: 192.168.0.0 to 192.168.255.255 (65,536 total addresses - standard for home routers and small office LANs).

Frequently Asked Questions

What is CIDR notation and how does subnetting work?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated routing prefix using a slash followed by the prefix bit length (e.g., 192.168.1.0/24). An IPv4 address contains 32 binary bits. The prefix number (e.g. /24) indicates that the first 24 bits represent the network address, leaving 8 bits for host addresses (yielding 2^8 = 256 total IP addresses, with 254 usable for devices).
Why are 2 IP addresses subtracted from the usable host count in standard IPv4?
In standard IPv4 networking, the very first IP in a subnet is reserved as the Network Identifier (the network itself), and the very last IP is reserved as the Broadcast Address (used to transmit packets to all hosts in the subnet simultaneously). Therefore, the formula for usable hosts is 2^(32 - prefix) - 2.
Why does AWS VPC reserve 5 IP addresses per subnet instead of 2?
In Amazon Web Services (AWS) VPC subnets, AWS reserves 5 IP addresses in every CIDR block: 1. Network address (.0), 2. VPC router (.1), 3. AWS DNS server (.2), 4. Future reserved usage (.3), and 5. Network broadcast (.255). For example, a /24 subnet in AWS provides 251 usable IP addresses rather than the standard 254.
What are the RFC 1918 Private IPv4 address ranges?
RFC 1918 defines three non-routable private IP address spaces for internal local networks: Class A (10.0.0.0/8 providing 16.7M IPs), Class B (172.16.0.0/12 providing 1.04M IPs), and Class C (192.168.0.0/16 providing 65,536 IPs). These addresses cannot be routed across the public internet.
What is a Wildcard Mask and where is it used?
A Wildcard Mask is the exact bitwise inverse of a subnet mask (calculated as 255.255.255.255 minus the Subnet Mask). For example, a /24 subnet mask is 255.255.255.0 and its wildcard mask is 0.0.0.255. Wildcard masks are widely used in Cisco IOS Access Control Lists (ACLs) and OSPF routing configurations.
What is the difference between /24, /28, and /16 subnets?
A /16 subnet provides 65,534 usable hosts (ideal for large enterprise datacenters or VPC parent CIDRs). A /24 subnet provides 254 usable hosts (standard for office LANs and microservice clusters). A /28 subnet provides 14 usable hosts (ideal for small database tiers, jump hosts, or point-to-point router links).
How do I split a large CIDR block into smaller subnets?
To divide a network into 2 equal subnets, increment the CIDR prefix by 1 (e.g. splitting 10.0.0.0/24 yields 10.0.0.0/25 and 10.0.0.128/25). To divide into 4 equal subnets, increment by 2 (yielding four /26 subnets of 64 IPs each).

Related Tools