Skip to content
utility2026-07-253 min read

What Is CIDR

CIDR (Classless Inter-Domain Routing) is a flexible method for allocating IP addresses and routing. It replaced the traditional classful addressing system (Class A, B, C), allowing more granular address space allocation.

CIDR notation appends a prefix length after the IP address with a slash:

192.168.1.0/24
             ^^
             Prefix length (network bits)

Why You Need a CIDR Calculator

  1. VPC network planning: Subnet design on cloud providers (AWS, Alibaba Cloud)
  2. Container networks: Kubernetes Pod network configuration
  3. Firewall rules: IP allowlist CIDR range configuration
  4. Server deployment: Internal IP address planning
  5. CDN configuration: IP range restrictions and edge node planning
  6. Security auditing: Analyzing IP range coverage

CIDR Fundamentals

IP Address Structure

An IPv4 address is a 32-bit binary number, typically shown in dotted decimal:

192.168.1.100
= 11000000.10101000.00000001.01100100

First 24 bits = network (/24), last 8 bits = hosts

Subnet Mask

The subnet mask distinguishes network from host portions:

| CIDR Prefix | Subnet Mask | Usable Hosts | Use Case | |-------------|-------------|-------------|----------| | /8 | 255.0.0.0 | 16,777,214 | Large organizations | | /16 | 255.255.0.0 | 65,534 | Medium networks | | /24 | 255.255.255.0 | 254 | Small networks (most common) | | /28 | 255.255.255.240 | 14 | Cloud VPC subnets | | /32 | 255.255.255.255 | 1 | Single host |

Usable Host Formula

Usable hosts = 2^(32 - prefix_length) - 2

Minus 2 because:

  • Network address (all host bits 0) is not assignable
  • Broadcast address (all host bits 1) is not assignable

Common CIDR Blocks

| CIDR | IPs | Description | |------|-----|-------------| | /32 | 1 | Single host | | /31 | 2 | Point-to-point link | | /30 | 4 | WAN link (2 usable IPs) | | /29 | 8 | Small subnet | | /28 | 16 | Common in cloud VPCs | | /27 | 32 | Medium subnet | | /24 | 256 | Class C size | | /16 | 65,536 | Class B size |

How to Use an Online CIDR Calculator

Using DevToolkit Pro's CIDR Calculator:

  1. Enter an IP address and CIDR prefix (e.g., 192.168.1.0/24)
  2. The tool automatically calculates:
    • Network address
    • Broadcast address
    • Subnet mask
    • Usable IP range
    • Host count
  3. Supports IP range to CIDR conversion

Cloud VPC Network Planning Example

Alibaba Cloud VPC Subnet Design

VPC CIDR: 10.0.0.0/16 (65,536 IPs)

├── Public subnet:     10.0.1.0/24  (254 IPs) ← Web servers
├── App subnet:        10.0.2.0/24  (254 IPs) ← App servers
├── Database subnet:   10.0.3.0/24  (254 IPs) ← Databases
├── Management subnet: 10.0.4.0/28  (14 IPs)  ← Bastion hosts
└── Kubernetes:        10.0.5.0/24  (254 IPs) ← Pod network

FAQ

What's the Difference Between /32 and /31?

/32 is a host route (exact match for one machine). /31 is a special format for point-to-point links that eliminates the need for network and broadcast addresses — both IPs are assignable to endpoints.

What Are Subnet Design Best Practices?

  1. Segment by function (web, app, database)
  2. Segment by environment (dev, staging, production)
  3. Reserve 20%+ for future expansion
  4. Use private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)

How Do I Check If Two CIDRs Overlap?

If two CIDRs produce the same result when ANDed with each other's subnet mask, they overlap. Online CIDR calculators can detect overlap directly.


This article is brought to you by DevToolkit Pro. More developer tools at the homepage.


ad