CIDR Calculator
Calculate IP address ranges, subnet masks, and network information using CIDR notation for network planning and management.
Calculate Your CIDR Calculator
What is CIDR Notation?
CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses and their associated routing prefix. It was introduced in 1993 to replace the earlier classful network addressing architecture, allowing for more efficient allocation of IP addresses and better route aggregation.
CIDR notation consists of an IP address followed by a slash (/) and a number that indicates how many bits are in the network portion of the address. For example, 192.168.1.0/24
indicates that the first 24 bits of the address represent the network, leaving 8 bits for host addresses.
Understanding IP Addressing
An IPv4 address consists of 32 bits, typically represented as four octets (bytes) separated by dots. Each octet represents 8 bits and can range from 0 to 255. For example, 192.168.1.1
is a typical IP address.
Binary Representation
IP addresses are fundamentally binary:
192.168.1.1 in binary is:
11000000.10101000.00000001.00000001
Network and Host Portions
CIDR divides an IP address into:
- Network portion: Identifies the network
- Host portion: Identifies specific devices on that network
CIDR Notation Explained
In CIDR notation, the prefix length after the slash specifies how many bits are used for the network portion:
CIDR Notation | Subnet Mask | Total Addresses | Usable Addresses |
---|---|---|---|
/24 | 255.255.255.0 | 256 | 254 |
/25 | 255.255.255.128 | 128 | 126 |
/26 | 255.255.255.192 | 64 | 62 |
/27 | 255.255.255.224 | 32 | 30 |
/28 | 255.255.255.240 | 16 | 14 |
/29 | 255.255.255.248 | 8 | 6 |
/30 | 255.255.255.252 | 4 | 2 |
For example, in 192.168.1.0/24
:
- The first 24 bits (192.168.1) represent the network address
- The remaining 8 bits (0-255) represent host addresses on that network
- This gives 256 total addresses (2^8), with 254 usable addresses (excluding network and broadcast addresses)
Key CIDR Calculations
Total Addresses in a Subnet
For a /24 network: 2^(32-24) = 2^8 = 256 addresses
Usable Addresses
We subtract 2 to account for the network address (first address) and broadcast address (last address)
Subnet Mask Calculation
A subnet mask consists of consecutive 1s for the network portion followed by 0s for the host portion.
For a /24 prefix, the subnet mask is:
11111111.11111111.11111111.00000000
Which translates to 255.255.255.0
Special Addresses
- Network Address: First address in the range (all host bits set to 0)
- Broadcast Address: Last address in the range (all host bits set to 1)
- First Usable Address: Network address + 1
- Last Usable Address: Broadcast address - 1
Private IP Ranges
10.0.0.0/8
- Large networks (16,777,214 hosts)172.16.0.0/12
- Medium networks (1,048,574 hosts)192.168.0.0/16
- Small networks (65,534 hosts)169.254.0.0/16
- Link-local addresses (APIPA)
CIDR in Network Design
Subnetting
CIDR allows networks to be divided into subnets of varying sizes, optimizing address allocation and improving network organization. Each subnet can be sized appropriately for its intended use.
Network Segmentation
Proper subnetting enhances security by isolating network segments and controlling traffic flow between them. This is particularly important for separating sensitive systems from general-purpose networks.
Route Aggregation
CIDR enables route summarization, allowing multiple network routes to be represented by a single routing table entry. This reduces routing table size and improves network performance.
CIDR Notation Examples
Common CIDR blocks and their uses:
- /32 - Single host address
Example: 192.168.1.10/32 (just one IP)
- /30 - Point-to-point links
Example: 192.168.1.0/30 (4 IPs, 2 usable)
- /29 - Very small subnet
Example: 192.168.1.0/29 (8 IPs, 6 usable)
- /24 - Small local network
Example: 192.168.1.0/24 (256 IPs, 254 usable)
- /16 - Large organization network
Example: 192.168.0.0/16 (65,536 IPs)
- /8 - Massive network
Example: 10.0.0.0/8 (16,777,216 IPs)
Related Calculators
Frequently Asked Questions
Share This Calculator
Found this calculator helpful? Share it with your friends and colleagues!