Loading network utility...
Loading network utility...
Converting CIDR notation like 10.0.0.0/22 to its usable start and end addresses requires understanding binary powers-of-two math. This guide provides quick formulas, cheat sheets, and practical cloud VPC subnetting examples.
Run live checks and calculations directly on LotsofNetwork.
In the early days of the Internet, IPv4 addresses were allocated according to rigid Class A, Class B, and Class C categories. A company needing 300 IP addresses could not obtain a Class C block (limited to 254 usable hosts) and was forced to request a full Class B block containing 65,534 addresses—wasting over 65,000 valid public IPs.
In 1993, the Internet Engineering Task Force introduced Classless Inter-Domain Routing (CIDR) under RFC 1519. CIDR eliminated fixed class boundaries by allowing subnet masks of any arbitrary prefix length between /0 and /32, drastically extending the lifespan of IPv4.
Converting a CIDR prefix to an address count is governed by binary powers of two:
1. Host Bits: An IPv4 address contains 32 total bits. If your CIDR prefix length is 'n', the number of available host bits is: h = 32 - n
2. Total IP Count: Total IPs = 2^h = 2^(32 - n)
3. Usable Host Count: In standard subnets (/30 and larger), the first address is reserved as the Network ID and the last address is reserved as the Broadcast ID: Usable Hosts = 2^(32 - n) - 2
| CIDR Prefix | Subnet Mask | Total Addresses (2^h) | Usable Hosts (2^h - 2) |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 (Point-to-Point Links) |
| /28 | 255.255.255.240 | 16 | 14 |
| /27 | 255.255.255.224 | 32 | 30 |
| /26 | 255.255.255.192 | 64 | 62 |
| /24 | 255.255.255.0 | 256 | 254 (Standard Office LAN) |
| /22 | 255.255.252.0 | 1,024 | 1,022 (Cloud VPC Subnet) |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /16 | 255.255.0.0 | 65,536 | 65,534 (VPC Supernet) |
Suppose you are provisioning an AWS VPC subnet with the CIDR block 10.0.0.0/22. How do you find its exact start and end IP addresses?
1. Step 1: Calculate Host Bits. h = 32 - 22 = 10 bits.
2. Step 2: Calculate Total Addresses. 2^10 = 1,024 total addresses.
3. Step 3: Determine the Block Span across octets. 1,024 addresses divided by 256 addresses per /24 octet equals 4 full Class C blocks.
4. Step 4: Map boundaries:
- Network Address: 10.0.0.0
- First Usable Host: 10.0.0.1
- Last Usable Host: 10.0.3.254
- Broadcast Address: 10.0.3.255
Network firewall rules and cloud security groups often require CIDR notation rather than arbitrary start-to-end IP ranges. However, because CIDR blocks must be binary powers of two aligned to their boundary, a range like 192.168.1.1 to 192.168.1.50 cannot be represented as a single CIDR block.
To convert an IP range to CIDR, engineers apply a greedy decomposition algorithm:
- 192.168.1.1/32 (1 IP: .1)
- 192.168.1.2/31 (2 IPs: .2 - .3)
- 192.168.1.4/30 (4 IPs: .4 - .7)
- 192.168.1.8/29 (8 IPs: .8 - .15)
- 192.168.1.16/28 (16 IPs: .16 - .31)
- 192.168.1.32/28 (16 IPs: .32 - .47)
- 192.168.1.48/31 (2 IPs: .48 - .49)
- 192.168.1.50/32 (1 IP: .50)
Total: Exactly 8 minimal binary blocks covering all 50 IP addresses cleanly.
When designing subnets for cloud environments like Amazon Web Services (AWS VPC), be aware that AWS reserves 5 total IP addresses in every subnet (the standard 2 plus 3 AWS internal addresses):
- .0: Network address
- .1: Reserved by AWS for the VPC router
- .2: Reserved by AWS for DNS (AmazonProvidedDNS)
- .3: Reserved by AWS for future network expansion
- .255: Network broadcast address
Therefore, in a /28 subnet (16 total IPs), only 11 usable IP addresses are available for EC2 instances or containers in AWS.
Quick answers to common questions on this topic.
High-speed, zero-cost engineering tools built for network diagnostics and developer workflows.
Detect IP, GeoIP, ISP, ASN & PTR
Reverse IP to PTR hostname & verify FCrDNS
Query A, AAAA, MX, TXT & NS records
Domain registrar & expiry info
Calculate CIDR, masks & host ranges
Inspect SSL expiry, issuer, SANs & TLS