How to Calculate CIDR Subnets
CIDR (Classless Inter-Domain Routing) notation is the standard way to define IP address ranges in modern networking. Whether you are setting up AWS VPCs, configuring firewall rules, or planning an on-prem network, knowing how to calculate subnets from CIDR blocks is essential. This guide walks you through the process step by step.
Quick Steps
- 1Open the CIDR Calculator
Navigate to the CIDR Calculator tool in the DevOps category.
- 2Enter a CIDR block
Type an address like 10.0.0.0/24 into the input field.
- 3Read the subnet breakdown
View the network address, broadcast address, host range, and total usable IPs.
- 4Split into smaller subnets
Choose a longer prefix to divide the block into equal sub-ranges.
- 5Copy your results
Copy the subnet info for use in cloud configs, firewall rules, or documentation.
CIDR Calculator
Calculate IP address ranges and subnet information
Understanding CIDR Notation
A CIDR block like 10.0.0.0/24 consists of two parts: the base IP address and the prefix length. The prefix length (the number after the slash) tells you how many bits of the address are fixed for the network portion. The remaining bits identify individual hosts. A /24 prefix, for example, uses 24 bits for the network and leaves 8 bits for hosts, giving you 256 addresses (254 usable, since the first is the network address and the last is the broadcast address).
Common CIDR Block Sizes
/32 = 1 address (single host)
/28 = 16 addresses (14 usable)
/24 = 256 addresses (254 usable)
/20 = 4,096 addresses
/16 = 65,536 addresses
/8 = 16,777,216 addressesHow to Use the CIDR Calculator
Type an IPv4 or IPv6 CIDR notation such as 192.168.1.0/26 into the input field.
The calculator displays the network address, broadcast address, first and last usable host, total addresses, and subnet mask.
Optionally divide the block into smaller subnets by selecting a new prefix length, for example splitting a /24 into four /26 blocks.
Copy the subnet details or the list of sub-ranges for use in your infrastructure configuration.
Best Practices for Subnet Planning
- Always leave room for growth by allocating larger blocks than you immediately need
- Align subnets on power-of-two boundaries to avoid wasted address space
- Use private RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) for internal networks
- Document every subnet allocation in a shared IPAM spreadsheet or tool
- Reserve the first and last few addresses in each subnet for gateways and infrastructure devices
Frequently Asked Questions
- What is the difference between /24 and /25?
- A /24 block has 256 addresses (254 usable hosts), while a /25 has 128 addresses (126 usable hosts). Each additional bit in the prefix length halves the number of available addresses.
- Does the calculator support IPv6?
- Yes. You can enter IPv6 CIDR blocks such as 2001:db8::/48 and the tool will display the full address range, prefix breakdown, and sub-netting options.
- How do I know which CIDR size to choose for a cloud VPC?
- Start by estimating the maximum number of hosts you will need across all subnets. A /16 gives you roughly 65,000 addresses, which is the maximum VPC size on AWS. For most workloads, a /20 or /21 per subnet provides a good balance between capacity and efficient address usage.
100% Private & Secure
This tool runs entirely in your browser. Your files and data never leave your device.
Related How-To Guides
Related Tools
Calculate IP subnet details from CIDR notation
Port ReferenceSearchable dictionary of common network ports and services
MAC Address LookupIdentify hardware vendor from MAC address
Crontab GeneratorVisual editor for creating cron schedule expressions
Dockerfile GeneratorGenerate Dockerfiles for various programming languages