CIDR Calculator

Classless Inter-Domain Routing (CIDR) notation expresses an IP address and its routing prefix together. Enter a CIDR block (e.g. 10.0.0.0/8) to compute all related network parameters.

CIDR Notation Explained

CIDR (Classless Inter-Domain Routing) replaced the old class-based IP addressing system in 1993, enabling more efficient allocation of IPv4 address space. The prefix length - The number after the slash - Indicates how many leading bits identify the network portion. The remaining bits identify individual hosts within that network.

Subnetting vs Supernetting

Subnetting splits a larger network into smaller subnetworks by extending the prefix length (e.g. dividing a /24 into two /25s). Supernetting (route aggregation) does the opposite - It combines multiple smaller networks into a larger summary route with a shorter prefix, reducing the number of entries in routing tables. Both use the same CIDR math.

Complete CIDR Reference Table

PrefixSubnet MaskTotal AddressesUsable HostsSubnets of /24
/8255.0.0.016,777,21616,777,21465,536
/9255.128.0.08,388,6088,388,60632,768
/10255.192.0.04,194,3044,194,30216,384
/11255.224.0.02,097,1522,097,1508,192
/12255.240.0.01,048,5761,048,5744,096
/13255.248.0.0524,288524,2862,048
/14255.252.0.0262,144262,1421,024
/15255.254.0.0131,072131,070512
/16255.255.0.065,53665,534256
/17255.255.128.032,76832,766128
/18255.255.192.016,38416,38264
/19255.255.224.08,1928,19032
/20255.255.240.04,0964,09416
/21255.255.248.02,0482,0468
/22255.255.252.01,0241,0224
/23255.255.254.05125102
/24255.255.255.02562541
/25255.255.255.128128126-
/26255.255.255.1926462-
/27255.255.255.2243230-
/28255.255.255.2401614-
/29255.255.255.24886-
/30255.255.255.25242-
/31255.255.255.25422-
/32255.255.255.25511-

Address Space by Prefix Length

Relative address space size (logarithmic scale)

/8 (16M addrs)
16.7M
/16 (65K addrs)
65K
/20 (4K addrs)
4,096
/24 (256 addrs)
256
/28 (16 addrs)
16
/30 (4 addrs)
4
/32 (1 addr)
1

Frequently Asked Questions

How do I calculate the number of hosts in a CIDR block?

The formula is: hosts = 2^(32 - prefix_length) - 2. For a /24: 2^(32-24) - 2 = 256 - 2 = 254. The -2 accounts for the network address and broadcast address. For /31 and /32 the standard rules do not apply - /31 is used for point-to-point links (RFC 3021) and /32 represents a single host.

What is the difference between CIDR and classful addressing?

Classful addressing divided IPv4 space into fixed classes: Class A (/8), Class B (/16), Class C (/24). This was wasteful - A company needing 300 IPs had to receive a full /16 (65K addresses). CIDR allows any prefix length, so that company can receive a /23 (512 addresses) instead, preserving scarce IPv4 space.

What is route aggregation and why does it matter?

Route aggregation (supernetting) combines multiple consecutive CIDR blocks into a single shorter-prefix route. For example, four /24 networks can be summarized as one /22. This reduces the size of global routing tables, which directly improves router performance and stability on the internet.

Related Tools