CIDR / Subnet Calculator

Calculate subnet details from CIDR notation. Enter an IP address with prefix length.

Understanding CIDR Notation

CIDR (Classless Inter-Domain Routing, pronounced "cider") is the modern system for allocating and routing IP addresses. Before CIDR was introduced in 1993, IP addresses were divided into rigid classes: Class A (/8, 16.7 million addresses), Class B (/16, 65,536 addresses), and Class C (/24, 256 addresses). This classful system was extremely wasteful — an organization that needed 300 addresses had to be allocated an entire Class B block of 65,536 addresses, leaving the vast majority unused. CIDR replaced this with variable-length subnet masking, allowing networks to be divided into blocks of any power-of-two size.

In CIDR notation, an IP address is followed by a slash and a number called the prefix length (e.g., 192.168.1.0/24). The prefix length specifies how many bits of the 32-bit IPv4 address represent the network portion. The remaining bits identify individual hosts within that network. A /24 prefix means the first 24 bits are the network address, leaving 8 bits for host addresses, which provides 256 total IP addresses (254 usable, since the network and broadcast addresses are reserved). A /16leaves 16 bits for hosts, providing 65,536 addresses. The smaller the prefix number, the larger the network.

CIDR also enables route aggregation (also called supernetting), where multiple smaller networks can be represented by a single, larger CIDR block in routing tables. This dramatically reduces the size of the global BGP routing table. For example, an ISP that owns the consecutive blocks 198.51.100.0/24 through 198.51.103.0/24 can advertise them as a single 198.51.100.0/22 route, reducing four routing table entries to one.

Common Subnet Sizes

The following table shows commonly used CIDR prefix lengths, their subnet masks, the total number of IP addresses in the block, and typical use cases. Understanding these standard sizes helps with network planning and IP address management.

  • /32 (255.255.255.255) — 1 IP. Used for host routes, loopback addresses, and specific firewall rules targeting a single IP.
  • /31 (255.255.255.254) — 2 IPs. Used for point-to-point links between two routers (RFC 3021). No broadcast address needed.
  • /30 (255.255.255.252) — 4 IPs (2 usable). Traditional point-to-point link subnet before /31 adoption.
  • /29 (255.255.255.248) — 8 IPs (6 usable). Small office or branch subnet.
  • /28 (255.255.255.240) — 16 IPs (14 usable). Small department or VLAN.
  • /27 (255.255.255.224) — 32 IPs (30 usable). Medium office subnet.
  • /26 (255.255.255.192) — 64 IPs (62 usable). Large department or server subnet.
  • /25 (255.255.255.128) — 128 IPs (126 usable). Half a Class C network.
  • /24 (255.255.255.0) — 256 IPs (254 usable). Standard "Class C" subnet. The most common allocation for small businesses and web hosting.
  • /16 (255.255.0.0) — 65,536 IPs. Large enterprise or ISP allocation.
  • /8 (255.0.0.0) — 16.7 million IPs. Major ISP or legacy Class A allocation.

To look up the geolocation of any IP within a subnet, use our IP geolocation lookup. To find which ASN announces a particular IP range and see all the prefixes they advertise, try our ASN lookup tool.

Want this data in your app?

Get a free API key and make 1,000 requests per day. All geolocation fields included, no credit card required.