490+ Tools Comprehensive Tools for Webmasters, Developers & Site Optimization

CIDR Calculator

Calculate subnet ranges and IP allocations for network planning

Format: IP/PREFIX (e.g., 192.168.1.0/24)

Understanding CIDR Notation

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing. It replaces the older system based on classes A, B, and C, allowing more flexible and efficient allocation of IP address space.

CIDR Notation Format

CIDR notation uses the format: IP_ADDRESS/PREFIX_LENGTH

Example: 192.168.1.0/24

  • 192.168.1.0: The network address
  • /24: The prefix length (number of network bits)

Prefix Length

The prefix length determines how many addresses are in the subnet:

  • /32: 1 address (single host)
  • /31: 2 addresses (point-to-point link)
  • /30: 4 addresses (2 usable)
  • /29: 8 addresses (6 usable)
  • /28: 16 addresses (14 usable)
  • /27: 32 addresses (30 usable)
  • /26: 64 addresses (62 usable)
  • /25: 128 addresses (126 usable)
  • /24: 256 addresses (254 usable)
  • /23: 512 addresses (510 usable)
  • /22: 1,024 addresses (1,022 usable)
  • /21: 2,048 addresses (2,046 usable)
  • /20: 4,096 addresses (4,094 usable)
  • /16: 65,536 addresses (65,534 usable)

Subnet Components

Network Address

The first address in the subnet, used to identify the network itself. Cannot be assigned to a host. All host bits are set to 0.

Broadcast Address

The last address in the subnet, used to send messages to all hosts in the network. Cannot be assigned to a host. All host bits are set to 1.

Usable Addresses

All addresses between the network and broadcast addresses. These can be assigned to hosts, routers, or other network devices.

Subnet Mask

A 32-bit number that separates the network portion from the host portion of an IP address. Network bits are set to 1, host bits to 0.

  • /24 = 255.255.255.0
  • /16 = 255.255.0.0
  • /8 = 255.0.0.0

Wildcard Mask

The inverse of the subnet mask. Used in some routing protocols and access control lists. Network bits are 0, host bits are 1.

Private IP Address Ranges

Reserved for private networks (RFC 1918):

  • 10.0.0.0/8: 10.0.0.0 - 10.255.255.255 (16,777,216 addresses)
  • 172.16.0.0/12: 172.16.0.0 - 172.31.255.255 (1,048,576 addresses)
  • 192.168.0.0/16: 192.168.0.0 - 192.168.255.255 (65,536 addresses)

Cloud VPC Planning

AWS VPC Best Practices

  • VPC CIDR: Use /16 for flexibility (10.0.0.0/16)
  • Subnet size: Use /24 for most subnets (254 usable IPs)
  • Reserved IPs: AWS reserves 5 IPs per subnet (first 4 + last 1)
  • Multi-AZ: Create subnets in multiple availability zones

Common VPC Layouts

Small Application (/16 VPC)
  • 10.0.1.0/24 - Public subnet AZ-A
  • 10.0.2.0/24 - Public subnet AZ-B
  • 10.0.11.0/24 - Private subnet AZ-A
  • 10.0.12.0/24 - Private subnet AZ-B
  • 10.0.21.0/24 - Database subnet AZ-A
  • 10.0.22.0/24 - Database subnet AZ-B
Large Application (/16 VPC with /20 subnets)
  • 10.0.0.0/20 - Public subnets (4,094 IPs)
  • 10.0.16.0/20 - Application tier
  • 10.0.32.0/20 - Database tier
  • 10.0.48.0/20 - Reserved for future use

Subnetting Tips

Plan for Growth

Choose larger CIDR blocks than immediately needed. It's easier to start large and not use all IPs than to expand later.

Avoid Overlapping

Ensure VPC CIDR blocks don't overlap if you plan to peer them or connect via VPN. Plan your IP addressing scheme across all networks.

Document Your Scheme

Maintain clear documentation of your IP allocation. Include purpose, environment, and region for each subnet.

Quick Reference
Common Subnet Sizes
  • /32: 1 host
  • /30: 2 hosts (links)
  • /28: 14 hosts
  • /27: 30 hosts
  • /26: 62 hosts
  • /24: 254 hosts (common)
  • /20: 4,094 hosts
  • /16: 65,534 hosts (VPC)
VPC Design Tips
  • Use /16 for VPC
  • Use /24 for subnets
  • Plan for multi-AZ
  • Separate public/private
  • Document IP scheme
  • Avoid overlapping CIDRs
  • Reserve space for growth