Type any CIDR block, like 10.0.0.0/16, and instantly see the full address range it covers, how many hosts fit inside it, and the subnet mask in both normal and hex form.
The prefix number tells us how many of the 32 bits are fixed (the network part).
The remaining bits are the host part, and they decide how big the block is.
Setting all host bits to 0 gives the first address. Setting them all to 1 gives the last address.
First address: Network address
Last address: Network + 2 ^ (32 − prefix) − 1
Block size: 2 ^ (32 − prefix)
CIDR notation writes an IP block as an address followed by a slash and a number, such as 10.20.0.0/20. The number says how many leading bits are fixed for the network. The IP CIDR calculator reads a block written this way and shows the start and end of the range, the usable host range, total and usable address counts, the subnet mask in decimal and hexadecimal, the wildcard mask and the address class.
This is the form in which address space is handed out and described in modern networking: in cloud VPC and subnet settings, ISP allocations, firewall objects, route tables and VPN configurations. Cloud and DevOps engineers use it to size VPCs and avoid overlapping ranges between environments. Network teams use it to read allocations from providers, and students use it to check how prefix length and block size relate.
1. Split the input at the slash into the address and the prefix length n.
2. Block size = 2^(32 − n). Each step of one in the prefix halves or doubles it: /24 = 256, /20 = 4,096, /16 = 65,536.
3. Range start = address with all host bits set to 0 (the network address).
4. Range end = start + block size − 1 (the broadcast address).
5. Usable hosts = block size − 2, running from start + 1 to end − 1, except for /31 and /32.
6. Mask = n ones followed by zeros; write it in dotted decimal and, if needed, in hex (each 8 bits is two hex digits).
Early IPv4 used fixed classes. Class A networks were /8, Class B /16 and Class C /24, decided by the first bits of the address. An organisation needing 2,000 addresses had to take a whole Class B of 65,536, wasting most of it. CIDR, introduced in 1993, removed this link, so any prefix length from /0 to /32 can be used. The calculator still shows the historical class for reference, but routing today depends only on the prefix length.
A /n block has 32 − n free host bits, so it contains exactly 2^(32 − n) addresses. Blocks always start on a multiple of their own size. A /20 has 4,096 addresses, which is 16 blocks of 256, so in the third octet it covers 16 values: 10.20.0.x to 10.20.15.x. The next /20 starts at 10.20.16.0. This alignment rule is why 10.20.8.0/20 is not a valid network address, since 8 is not a multiple of 16.
Because blocks are aligned powers of two, adjacent blocks can be summarised. Two /21s, 10.20.0.0/21 and 10.20.8.0/21, combine into one /20, so a router needs a single route instead of two. This route aggregation keeps internet routing tables manageable. The same arithmetic tells you whether two ranges overlap: one block overlaps another only if one contains the other. In cloud setups, overlapping VPC ranges block peering and VPNs, which is why planning with CIDR matters early.
Siddharth is creating a VPC subnet for a staging environment at a Hyderabad fintech. The platform team has reserved 10.20.0.0/20 for him and he wants to see its full range before carving it up.
CIDR block: 10.20.0.0/20
Prefix /20 leaves 32 − 20 = 12 host bits, so block size = 2^12 = 4,096 addresses.
Mask = 20 ones = 11111111.11111111.11110000.00000000 = 255.255.240.0, or 0xfffff000 in hex. Wildcard = 0.0.15.255.
Range start (network) = 10.20.0.0, since the third octet 0 is a multiple of 16 and the host bits are all zero.
Range end (broadcast) = start + 4,096 − 1. 4,096 addresses = 16 × 256, so the third octet runs 0 to 15 and the end is 10.20.15.255.
Usable hosts = 4,096 − 2 = 4,094, from 10.20.0.1 to 10.20.15.254. The next block is 10.20.16.0/20.
Answer: 10.20.0.0/20 covers 10.20.0.0 to 10.20.15.255: 4,096 addresses, 4,094 usable (10.20.0.1 to 10.20.15.254), mask 255.255.240.0 (0xfffff000).
Writing a CIDR block whose address is not on the block boundary, such as 10.20.8.0/20.
Assuming a larger prefix number means a larger network; /28 is much smaller than /20.
Choosing overlapping ranges for different VPCs or sites that later need to connect.
Forgetting that cloud platforms reserve a few addresses in every subnet beyond network and broadcast.
Using public address space inside a private network instead of the RFC 1918 ranges.
Sizing cloud VPCs and subnets before deployment.
Reading address allocations from an ISP or data centre.
Checking for overlaps before setting up site-to-site VPNs or peering.
Writing firewall and routing objects that use CIDR notation.
What does the number after the slash mean?
It tells you how many bits are fixed as the network part. A /16 fixes the first 16 bits, leaving 16 bits for hosts — that's 65,536 addresses in total.
Which private ranges can I use on an internal network?
You can use 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are set aside for private use by RFC 1918 and cannot be used on the public internet.