Tools / cidr
CIDR calculator.
This CIDR calculator works out the range, masks and host count of any IPv4 subnet. A block like 10.0.0.0/16 names a range of addresses, and the number after the slash says how many of the 32 bits are fixed, so a /16 holds 65,536 addresses and a /24 holds 256. Cloud subnets leave you fewer: AWS and Azure keep 5 addresses in every subnet, Google Cloud keeps 4. Type a block below to see its range, masks and what each cloud leaves you. The calculations run in your browser.
10.0.0.0/16: 65,534 usable hosts, Private (RFC 1918).
Result
- CIDR
- 10.0.0.0/16
- Range
- 10.0.0.0 – 10.0.255.255
- Network
- 10.0.0.0
- Broadcast
- 10.0.255.255
- Netmask
- 255.255.0.0
- Wildcard
- 0.0.255.255
- First host
- 10.0.0.1
- Last host
- 10.0.255.254
- Addresses
- 65,536
- Usable hosts
- 65,534
- Class
- A
- Scope
- Private (RFC 1918)
AWS, Azure and GCP usable IPs
| Provider | Usable |
|---|---|
| AWS VPCReserves 5: network, VPC router, DNS, one held for future use, broadcast | 65,531 |
| Azure VNetReserves 5: network, default gateway, two for Azure DNS, broadcast | 65,531 |
| Google Cloud VPCReserves 4: network, default gateway, second-to-last, broadcast | 65,532 |
In binary
network bits host bits
Split into smaller subnets
4 subnets of 16,384 addresses each.
| # | Subnet | Hosts | Broadcast |
|---|---|---|---|
| 1 | 10.0.0.0/18 | 10.0.0.1 – 10.0.63.254 | 10.0.63.255 |
| 2 | 10.0.64.0/18 | 10.0.64.1 – 10.0.127.254 | 10.0.127.255 |
| 3 | 10.0.128.0/18 | 10.0.128.1 – 10.0.191.254 | 10.0.191.255 |
| 4 | 10.0.192.0/18 | 10.0.192.1 – 10.0.255.254 | 10.0.255.255 |
Guide
How to use the CIDR calculator.
You can also work out a range by hand, which is a good way to check an answer.
- Type a block such as 10.0.0.0/16 into the box. An address with a netmask works too, like 10.0.0.5 255.255.0.0.
- Read the result: the IP range, network and broadcast addresses, netmask, wildcard mask and how many hosts fit. The cloud panel shows what AWS, Azure and Google Cloud leave you after their reserved addresses.
- Split the block or check it against another. Splitting 10.0.0.0/16 into /18s gives four subnets of 16,384 addresses: 10.0.0.0/18, 10.0.64.0/18, 10.0.128.0/18 and 10.0.192.0/18. The CIDR overlap checker tells you whether two ranges clash before you peer them.
CIDR to IP range, by hand
Take 192.168.10.37/27. A /27 leaves 5 host bits, so each block holds 25 = 32 addresses and starts at a multiple of 32 in the last octet. 37 falls between 32 and 63, so the network address is 192.168.10.32 and the broadcast address is 192.168.10.63. The hosts run from 192.168.10.33 to 192.168.10.62, which is 30 usable addresses.
AWS, Azure and GCP subnet sizes
A normal subnet loses 2 addresses, the network and the broadcast. Cloud providers keep more. AWS keeps 5 (network, VPC router, DNS, one held for future use, broadcast), Azure keeps 5 (network, default gateway, two for Azure DNS, broadcast) and Google Cloud keeps 4 (network, default gateway, second-to-last, broadcast). AWS subnets also stop at /28, while Azure and Google Cloud go down to /29.
| Prefix | Addresses | Usable | AWS | Azure | Google Cloud |
|---|---|---|---|---|---|
| /16 | 65,536 | 65,534 | 65,531 | 65,531 | 65,532 |
| /17 | 32,768 | 32,766 | 32,763 | 32,763 | 32,764 |
| /18 | 16,384 | 16,382 | 16,379 | 16,379 | 16,380 |
| /19 | 8,192 | 8,190 | 8,187 | 8,187 | 8,188 |
| /20 | 4,096 | 4,094 | 4,091 | 4,091 | 4,092 |
| /21 | 2,048 | 2,046 | 2,043 | 2,043 | 2,044 |
| /22 | 1,024 | 1,022 | 1,019 | 1,019 | 1,020 |
| /23 | 512 | 510 | 507 | 507 | 508 |
| /24 | 256 | 254 | 251 | 251 | 252 |
| /25 | 128 | 126 | 123 | 123 | 124 |
| /26 | 64 | 62 | 59 | 59 | 60 |
| /27 | 32 | 30 | 27 | 27 | 28 |
| /28 | 16 | 14 | 11 | 11 | 12 |
| /29 | 8 | 6 | Not allowed | 3 | 4 |
Reference
Prefix sizes at a glance.
Every prefix from /0 to /32 with its netmask and how many hosts it holds. Each /8 to /32 row opens a page with a worked example and cloud counts; the common blocks page covers 10.0.0.0/8, 192.168.1.0/24 and other ranges you’ll meet.
| Prefix | Netmask | Addresses | Usable hosts |
|---|---|---|---|
| /0 | 0.0.0.0 | 4,294,967,296 | 4,294,967,294 |
| /1 | 128.0.0.0 | 2,147,483,648 | 2,147,483,646 |
| /2 | 192.0.0.0 | 1,073,741,824 | 1,073,741,822 |
| /3 | 224.0.0.0 | 536,870,912 | 536,870,910 |
| /4 | 240.0.0.0 | 268,435,456 | 268,435,454 |
| /5 | 248.0.0.0 | 134,217,728 | 134,217,726 |
| /6 | 252.0.0.0 | 67,108,864 | 67,108,862 |
| /7 | 254.0.0.0 | 33,554,432 | 33,554,430 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /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 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
How CIDR works
Quick answers.
When you pick address space for a new VPC, leave room to grow and stay clear of any network you might peer with later. Renumbering a network once it’s live is much harder.
What does the number after the slash mean?
It’s the prefix length: how many of the 32 bits in an IPv4 address are fixed as the network part. A /24 fixes the first 24 bits, which leaves 8 bits, or 256 addresses, for hosts. Each step down doubles the block: a /23 has 512 addresses, a /16 has 65,536.
How do I find the IP range of a CIDR block?
Work out the block size from the prefix, then find the multiple of that size your address falls in. For 192.168.10.37/27, a /27 leaves 5 host bits, so blocks are 32 addresses long. 37 sits between 32 and 63, so the range is 192.168.10.32 to 192.168.10.63, with usable hosts from .33 to .62. The CIDR calculator on this page does this for any block.
What is the difference between CIDR notation and a subnet mask?
They say the same thing in two ways. CIDR notation gives the number of network bits after a slash, and a subnet mask writes those bits out as four octets. So /24 and 255.255.255.0 describe the same split, as do /26 and 255.255.255.192. CIDR is shorter, and it’s what cloud consoles and most routing tables use.
What size subnet do I need for 50 hosts?
A /26. It holds 64 addresses and leaves 62 usable on a normal network, 59 on AWS and Azure (they keep 5) and 60 on Google Cloud (it keeps 4). A /27 is too small, with only 30 usable. The “Subnet size for N hosts” tool on this page works this out for any number.
Why does a /24 have 254 usable hosts and not 256?
The first address is the network address and the last is the broadcast address, so neither can go on a host. The exceptions are a /31, where both addresses are usable on a point-to-point link (RFC 3021), and a /32, which is a single host.
Why does AWS only give me 251 IPs in a /24 subnet?
AWS reserves five addresses in every subnet: the network address, the VPC router (+1), the DNS server (+2), one held for future use (+3) and the last address. Azure also reserves five. Google Cloud reserves four: the network address, the default gateway, the second-to-last address and the broadcast address.
What is a wildcard mask?
The netmask with every bit flipped. Where the netmask is 255.255.255.0, the wildcard is 0.0.0.255. Cisco ACLs and OSPF use wildcard masks to say which bits of an address can vary.
Can two CIDR blocks partly overlap?
No. Two CIDR blocks are either completely separate or one sits entirely inside the other. If one range contains the other, VPC peering and VPN routes between them fail, so check before you pick address space.
What are IP address classes A, B, C, D and E?
Before CIDR, the first octet of an address fixed its network size. Class A (0–127) used a /8, class B (128–191) a /16 and class C (192–223) a /24. Class D (224–239) is multicast and class E (240–255) is reserved. CIDR replaced classes in 1993 (RFC 1519), so any prefix length now works anywhere; the calculator still shows the class because older docs and exams use it.
| Class | First octet | Default prefix | Use |
|---|---|---|---|
| A | 0–127 | /8 (255.0.0.0) | Unicast |
| B | 128–191 | /16 (255.255.0.0) | Unicast |
| C | 192–223 | /24 (255.255.255.0) | Unicast |
| D | 224–239 | None | Multicast |
| E | 240–255 | None | Reserved |
How many usable IPs are in a /26, /27 or /28?
A /26 has 62 usable hosts, a /27 has 30 and a /28 has 14. Each extra prefix bit halves the block: 64 addresses, then 32, then 16, and each loses 2 to the network and broadcast addresses. On AWS and Azure take away 3 more (59, 27 and 11); on Google Cloud take away 2 more (60, 28 and 12).
| Prefix | Addresses | Usable | AWS / Azure | Google Cloud |
|---|---|---|---|---|
| /26 | 64 | 62 | 59 | 60 |
| /27 | 32 | 30 | 27 | 28 |
| /28 | 16 | 14 | 11 | 12 |
What is 255.255.255.240 in CIDR notation?
It’s /28. Count the 1-bits in the netmask: each 255 is 8 bits, and 240 is 11110000 in binary, which is 4 bits. That makes 8 + 8 + 8 + 4 = 28. A /28 holds 16 addresses and 14 usable hosts. The same method works for any mask: 255.255.255.0 is /24 and 255.255.255.192 is /26.
Should I use a /30 or /31 for a point-to-point link?
Use a /31 if both ends support it. RFC 3021 lets a point-to-point link use both addresses of a /31, because a link with two ends needs no network or broadcast address. A /30 holds 4 addresses but only 2 are usable, so it wastes half the block. Keep /30 for older equipment that doesn’t accept /31.
How do I split a /24 into 4 equal subnets?
Add 2 bits to the prefix: 2 extra bits make 4 subnets, so a /24 splits into four /26s of 64 addresses each. For 192.168.10.0/24 they are 192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26 and 192.168.10.192/26, each with 62 usable hosts. The splitter in the calculator above does this for any block.
| Subnet | Hosts | Broadcast |
|---|---|---|
| 192.168.10.0/26 | 192.168.10.1 – 192.168.10.62 | 192.168.10.63 |
| 192.168.10.64/26 | 192.168.10.65 – 192.168.10.126 | 192.168.10.127 |
| 192.168.10.128/26 | 192.168.10.129 – 192.168.10.190 | 192.168.10.191 |
| 192.168.10.192/26 | 192.168.10.193 – 192.168.10.254 | 192.168.10.255 |