Skip to content

CIDR notation · ranges · masks

CIDR calculator.

Convert any CIDR block to its IP range, subnet mask, wildcard mask and host count — and see exactly how the numbers are calculated.

Enter an IP with a prefix, e.g. 10.0.0.0/22 or 172.16.0.0/12

CIDR notation10.0.0.0/22
Subnet mask255.255.252.0
Wildcard mask0.0.3.255
First IP (network address)10.0.0.0
Last IP (broadcast address)10.0.3.255
Usable host range10.0.0.1 – 10.0.3.254
Total addresses1,024
Usable hosts1,022

What is CIDR?

CIDR (Classless Inter-Domain Routing, pronounced “cider”) is the standard way to describe an IP network by its address and prefix length. A CIDR block such as 203.0.113.0/24 means “the 256 addresses that share the first 24 bits with 203.0.113.0”. Before CIDR, addresses were handed out in fixed class A, B and C sizes, which wasted huge amounts of space. CIDR lets providers and administrators allocate exactly the size they need, and lets routers aggregate many routes into one — the reason the global routing table is manageable today.

CIDR notation explained

In CIDR notation the number after the slash is the prefix length: how many of the 32 bits belong to the network. The remaining bits are the host part. A larger prefix number means a smaller network: /30 has 4 addresses, /24 has 256 and /16 has 65,536.

192.168.10.0/26
  prefix length  = 26  → 26 network bits, 6 host bits
  subnet mask    = 255.255.255.192
  total addresses= 2^6 = 64
  usable hosts   = 64 − 2 = 62
  range          = 192.168.10.0 – 192.168.10.63

CIDR calculation formula

  • Total addresses = 2(32 − prefix)
  • Usable hosts = 2(32 − prefix) − 2 (network and broadcast addresses)
  • Block size in the “interesting” octet = 256 − the mask value in that octet
  • Network address = IP address AND subnet mask
  • Broadcast address = network address OR wildcard mask

CIDR to subnet mask conversion table

CIDRSubnet maskWildcardAddresses
/16255.255.0.00.0.255.25565,536
/20255.255.240.00.0.15.2554,096
/22255.255.252.00.0.3.2551,024
/24255.255.255.00.0.0.255256
/26255.255.255.1920.0.0.6364
/28255.255.255.2400.0.0.1516
/30255.255.255.2520.0.0.34

The complete list from /0 to /32 is on the subnet mask cheat sheet.

CIDR vs classful addressing

Classful addressing fixed the network size by the first octet: class A was always /8, class B /16 and class C /24. CIDR removed that link, so a company that needed 2,000 addresses could receive a /21 instead of a whole class B. See IP address classes for the old ranges and VLSM vs CIDR for how the two ideas fit together.

CIDR for AWS, Azure and Google Cloud

Cloud networks are defined with CIDR blocks. Choose a private RFC 1918 range for each VPC or VNet, keep ranges unique across every network you may connect, and leave room to grow — a /16 VPC split into /24 subnets gives you 256 subnets per VPC. Remember that clouds reserve a few addresses in each subnet (AWS reserves five), so a /28 subnet gives 11 usable addresses there, not 14. Use the calculator above to check a block before you create it.

Frequently asked questions

What is the full form of CIDR?

CIDR stands for Classless Inter-Domain Routing. It is the method of allocating IP addresses and routing traffic that replaced the old classful (class A, B, C) system in 1993 and is defined in RFC 4632.

What does CIDR notation mean?

CIDR notation writes an IP address followed by a slash and the prefix length, for example 192.168.10.0/24. The number after the slash is how many leading bits identify the network; the remaining bits identify hosts.

What is the CIDR calculation formula?

The number of addresses in a CIDR block is 2^(32 − prefix). Usable hosts are that number minus 2 (network and broadcast), except /31 (2 usable) and /32 (1). A /26 therefore has 2^6 = 64 addresses and 62 usable hosts.

How do I convert CIDR to a subnet mask?

Write the prefix as that many 1 bits followed by 0s to fill 32 bits, then convert each 8-bit group to decimal. /20 is 11111111.11111111.11110000.00000000 = 255.255.240.0.

What CIDR block should I use for an AWS VPC?

AWS lets you create a VPC between /16 (65,536 addresses) and /28 (16 addresses) from RFC 1918 space. Pick a block that does not overlap other VPCs or on-premises networks you may peer with, and remember AWS reserves 5 addresses in every subnet.