CIDR notation

CIDR notation writes an IP range as an address plus a prefix length, such as 192.0.2.0/24, where the number tells how many leading bits are fixed.

What CIDR is

CIDR stands for Classless Inter-Domain Routing. In practice it is the slash notation used to describe a block of IP addresses: 192.0.2.0/24. The part before the slash is the first address of the block; the number after it, the prefix length, says how many bits from the left are shared by every address in the block. The remaining bits are free, so /24 on an IPv4 address leaves 8 bits and covers 256 addresses, from 192.0.2.0 to 192.0.2.255.

The same idea applies to IPv6, where prefixes are much longer in bits and much larger in count: a /64 holds 18 quintillion addresses, and a /48 holds 65,536 of those /64 networks.

Reading prefix lengths

A shorter prefix is a bigger block:

  • /8 is 16,777,216 IPv4 addresses, the size of an early "class A".
  • /16 is 65,536 addresses.
  • /24 is 256 addresses, the most common size seen in routing tables.
  • /32 is a single IPv4 address; /128 is a single IPv6 address.

A subnet mask such as 255.255.255.0 expresses the same /24 boundary in the older dotted form.

Why it matters

Networks announce their address space to the internet as CIDR prefixes, and registries record who holds each prefix. When you look up an address, the result includes the prefix it was found in, which tells you how large the owning block is. Blocklists, firewall rules, and geolocation databases all work at the prefix level too, which is why a whole /24 can inherit the reputation of one abusive host inside it, and why a proxy that sits in the same /24 as a known server range is easily recognized.

How to check

The subnet calculator expands any CIDR block into its first and last address, netmask, wildcard mask, and usable host count, and converts between mask and prefix length. ASN lookup lists the prefixes a network announces, and WHOIS shows the registered block that contains an address.

A common misconception

CIDR blocks must start on a boundary that matches the prefix length. 192.0.2.10/24 is not a valid way to write a block; the calculator will normalize it to 192.0.2.0/24 and tell you where the address sits inside it.

Sponsored · advertise here