VPC Subnet Calculator

Advanced VPC Subnet Calculator with Variable Sizing

Calculate CIDR ranges, subnet masks, and usable IPs for AWS, GCP, Azure, Oracle, or custom VPCs. Create variable-sized subnets based on your specific IP requirements or split into equal subnets. Export infrastructure as Terraform or Ansible configurations.

Input Configuration

/16 to /28 CIDR ranges supported • Reserves 5 IPs

Format: XXX.XXX.XXX.XXX (each part 0-255)

/

Calculation Results

No results yet. Enter IP and CIDR, then click Calculate.

Real-World Subnet Design Examples

AWS VPC with Multi-Tier Architecture

Setting up a VPC with public, private, and database subnets across two availability zones

AWS
Base Network:
10.0.0.0/16
Subnet Allocation:
Public Subnet AZ-A:10.0.1.0/24
Load balancers, NAT gateways254 usable IPs
Public Subnet AZ-B:10.0.2.0/24
Load balancers, NAT gateways254 usable IPs
Private Subnet AZ-A:10.0.10.0/24
Application servers254 usable IPs
Private Subnet AZ-B:10.0.11.0/24
Application servers254 usable IPs
Database Subnet AZ-A:10.0.20.0/28
RDS instances14 usable IPs
Database Subnet AZ-B:10.0.21.0/28
RDS instances14 usable IPs

Google Cloud Regional Network

GCP VPC with auto-scaling Kubernetes cluster subnets

GCP
Base Network:
10.128.0.0/20
Subnet Allocation:
GKE Nodes:10.128.0.0/22
Kubernetes worker nodes1022 usable IPs
GKE Pods:10.128.4.0/22
Pod IP allocation1022 usable IPs
Services:10.128.8.0/24
Load balancers, ingress254 usable IPs
Management:10.128.9.0/28
Monitoring, logging14 usable IPs

Oracle Cloud Compartment Design

Oracle VCN with compartmentalized subnets for enterprise workloads

Oracle
Base Network:
172.16.0.0/16
Subnet Allocation:
Web Tier:172.16.1.0/24
Public-facing web servers254 usable IPs
App Tier:172.16.10.0/23
Application servers510 usable IPs
Data Tier:172.16.20.0/26
Database servers62 usable IPs
Management:172.16.30.0/28
Bastion, monitoring14 usable IPs

Use Cases by Industry & Scale

Enterprise Deployment

Common Scenarios:
  • Multi-region VPC setup with consistent IP schemes
  • Disaster recovery subnet planning
  • Hybrid cloud connectivity with on-premises networks
  • Large-scale microservices architecture
Recommended Sizes:
/16 for VPC
/24 for app subnets
/28 for databases

Development Environment

Common Scenarios:
  • Dev/staging/prod environment isolation
  • Feature branch environment provisioning
  • CI/CD pipeline subnet allocation
  • Testing and QA environment setup
Recommended Sizes:
/20 for dev VPC
/26 for small envs
/24 for main stages

Container Orchestration

Common Scenarios:
  • Kubernetes cluster node subnets
  • Pod network IP allocation
  • Service mesh networking
  • Ingress controller placement
Recommended Sizes:
/22 for nodes
/20 for pods
/28 for services

IoT & Edge Computing

Common Scenarios:
  • IoT device network segmentation
  • Edge computing node connectivity
  • Sensor data collection networks
  • Remote site VPN connections
Recommended Sizes:
/24 for edge sites
/26 for IoT segments
/30 for P2P links

Practical Sizing Examples

Small Startup (< 50 servers)

10.0.0.0/24
10.0.0.0/26
Web servers (62 IPs)
~15 servers
10.0.0.64/26
App servers (62 IPs)
~20 servers
10.0.0.128/27
Databases (30 IPs)
~5 servers
10.0.0.160/28
Management (14 IPs)
~5 servers

Medium Company (< 500 servers)

10.0.0.0/20
10.0.0.0/22
Web tier (1022 IPs)
~200 servers
10.0.4.0/22
App tier (1022 IPs)
~250 servers
10.0.8.0/24
Database tier (254 IPs)
~30 servers
10.0.9.0/26
Management (62 IPs)
~20 servers

Enterprise (1000+ servers)

10.0.0.0/16
10.0.0.0/20
Production workloads
~4000 IPs
10.0.16.0/20
Staging environment
~4000 IPs
10.0.32.0/20
Development environment
~4000 IPs
10.0.48.0/22
Shared services
~1000 IPs

Quick Reference: Common CIDR Sizes

/30
4 (2 usable)
Point-to-point links
/28
16 (14 usable)
Small services
/27
32 (30 usable)
Database subnets
/26
64 (62 usable)
App server groups
/25
128 (126 usable)
Medium deployments
/24
256 (254 usable)
Standard subnets
/23
512 (510 usable)
Large app tiers
/22
1,024 (1,022 usable)
Container clusters
/21
2,048 (2,046 usable)
Auto-scaling groups
/20
4,096 (4,094 usable)
Large environments
/19
8,192 (8,190 usable)
Multi-tier VPCs
/16
65,536 (65,534 usable)
Enterprise VPCs

VPC Subnet Calculation Guide

Understanding CIDR Notation

CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length to define network boundaries. For example, 10.0.0.0/24 means the first 24 bits represent the network portion, leaving 8 bits for host addresses (256 total IPs, 254 usable after excluding network and broadcast addresses).

Cloud Provider CIDR Limits

AWS VPC

/16 to /28 (16-65,536 IPs)

Minimum /28 for subnets, maximum /16 for VPC

Google Cloud

/10 to /29 (8-4,194,304 IPs)

Flexible subnet sizing with auto-expansion

Oracle Cloud

/16 to /30 (4-65,536 IPs)

Regional subnets with availability domain distribution

Microsoft Azure

/8 to /29 (8-16,777,216 IPs)

Virtual networks with subnet delegation support

Common Use Cases for DevOps

  • Designing VPC subnets for AWS, GCP, Oracle, or Azure deployments
  • Splitting a large CIDR block into separate subnets for public, private, and database tiers
  • Calculating usable IP addresses for cloud infrastructure capacity planning
  • Planning subnet allocation for microservices architecture and container orchestration
  • Designing multi-tier application networks with proper IP isolation
  • Creating disaster recovery and multi-region subnet strategies
  • Planning IP address space for Kubernetes clusters and pod networking

Best Practices for Subnet Design

  • Start with larger CIDR blocks (e.g., /16) for flexibility in VPC design
  • Reserve IP ranges for future scaling when initially splitting subnets
  • Avoid overlapping subnets within the same VPC or across peered networks
  • Plan for multiple availability zones when designing subnet layouts
  • Use consistent IP allocation patterns across environments (dev, staging, prod)
  • Document subnet purposes and IP allocations for team reference

Subnet Planning Tips

IP Address Reservations

  • • Network address (first IP) - Reserved for network identification
  • • Broadcast address (last IP) - Reserved for broadcast communications
  • • Cloud provider reserved IPs - Typically first few IPs in subnet
  • • Gateway addresses - Usually .1 or .4 depending on provider

Capacity Planning

  • • Factor in auto-scaling requirements for compute instances
  • • Plan for container/pod IP allocation in Kubernetes clusters
  • • Consider load balancer and NAT gateway IP requirements
  • • Account for monitoring and logging service IPs

Private IP Address Ranges

Use these RFC 1918 private IP ranges for internal networks:

Class A: 10.0.0.0/8
10.0.0.0 - 10.255.255.255
Class B: 172.16.0.0/12
172.16.0.0 - 172.31.255.255
Class C: 192.168.0.0/16
192.168.0.0 - 192.168.255.255

Advanced Subnet Strategies

Multi-Tier Architecture

  • Public Subnet: Load balancers, bastion hosts (/28 or /27)
  • Private Subnet: Application servers, APIs (/24 or /23)
  • Database Subnet: RDS, managed databases (/28 or /27)
  • Management Subnet: Monitoring, logging services (/28)

Container Orchestration

  • Node Subnets: Kubernetes worker nodes (/24)
  • Pod Networks: CNI-specific IP ranges (varies by provider)
  • Service Networks: ClusterIP and LoadBalancer IPs
  • Ingress Subnets: External load balancer placement

Troubleshooting Common Issues

IP Exhaustion

Monitor subnet utilization and plan expansion before reaching 80% capacity. Consider subnet expansion or additional subnets in different AZs.

Overlapping Ranges

Use IP Address Management (IPAM) tools to track allocations and prevent conflicts during VPC peering or VPN connections.

Route Table Complexity

Keep subnet designs simple and document routing decisions. Use subnet tags and naming conventions for easier management.

Subnet Calculator Features

Core Calculations:

  • • CIDR notation validation
  • • Subnet mask computation
  • • Network and broadcast addresses
  • • Usable IP range determination

Advanced Features:

  • • Subnet splitting and allocation
  • • Cloud provider validation
  • • Result export and sharing
  • • Preference saving