Home
Enter a valid IPv4 address.
Slash notation (0-32).
Display IPs and masks in binary.
Visualize the subnet allocation.
For numeric results.

What Is CIDR?

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing Internet Protocol packets. It was introduced in 1993 to replace the classful network design (Class A, B, C) and allows for more efficient use of IPv4 address space.

CIDR notation is written as an IP address followed by a slash and a number (e.g., 192.168.1.0/24). The number after the slash represents the prefix length — the number of bits used for the network portion of the address. The remaining bits are used for host addresses within the subnet.

This calculator takes a CIDR block and computes all the essential subnet details:

  • Network Address: The first address in the subnet (all host bits are 0).
  • Broadcast Address: The last address in the subnet (all host bits are 1).
  • Subnet Mask: The 32-bit mask that defines the network portion.
  • Wildcard Mask: The inverse of the subnet mask (used in ACLs).
  • Host Range: The range of assignable IP addresses for devices.
  • Total & Usable Hosts: The number of addresses in the subnet and how many can be assigned.

How Does the CIDR Calculator Work?

The calculator uses bitwise operations to compute subnet details:

Step 1: Convert the IP address to a 32-bit integer.

Step 2: Calculate the subnet mask by setting the first N bits to 1 (where N is the CIDR prefix).

Step 3: Compute the network address by ANDing the IP with the subnet mask.

Step 4: Compute the broadcast address by ORing the network address with the wildcard mask.

Step 5: Calculate the first and last usable hosts (network + 1 and broadcast - 1).

Step 6: Determine the total hosts (2^(32 - prefix)) and usable hosts (total - 2).

The results are displayed in both decimal and optional binary formats for a complete understanding of the subnet structure.

Why Use This CIDR Calculator?

  • Comprehensive: Calculates all essential subnet details at a glance.
  • Binary Support: Optionally view IPs and masks in binary for learning and debugging.
  • Visual Chart: Optional visualization of the subnet allocation.
  • Educational: Perfect for students learning subnetting.
  • Free & Private: No registration, no data storage.

Common CIDR Prefixes

  • /8 (255.0.0.0): 16,777,214 usable hosts (Class A equivalent)
  • /16 (255.255.0.0): 65,534 usable hosts (Class B equivalent)
  • /24 (255.255.255.0): 254 usable hosts (Class C equivalent)
  • /28 (255.255.255.240): 14 usable hosts
  • /30 (255.255.255.252): 2 usable hosts (point-to-point links)
  • /32 (255.255.255.255): 1 host (single IP address)

❓ CIDR Calculator FAQ

What is CIDR?

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing IP packets. It uses a prefix length (e.g., /24) to specify how many bits are used for the network portion of the address.

What is the difference between CIDR and subnet mask?

CIDR uses a prefix length (e.g., /24) to represent the subnet mask. A subnet mask (e.g., 255.255.255.0) is the dotted-decimal equivalent. They both define the same network boundary.

How do I calculate the subnet mask from a CIDR prefix?

The subnet mask has the first N bits set to 1, where N is the CIDR prefix. For /24, the mask is 255.255.255.0. The calculator does this for you automatically.

What is a wildcard mask?

A wildcard mask is the inverse of a subnet mask. It is used in access control lists (ACLs) to specify which bits to match. For /24, the wildcard mask is 0.0.0.255.

What is the network address?

The network address is the first address in a subnet. All host bits are set to 0. It identifies the subnet itself and cannot be assigned to a host.

What is the broadcast address?

The broadcast address is the last address in a subnet. All host bits are set to 1. It is used to send data to all hosts in the subnet and cannot be assigned to a host.

How many usable hosts are in a /24 subnet?

A /24 subnet has 256 total addresses, of which 2 are reserved (network and broadcast). The number of usable hosts is 254.

What is the host range in a subnet?

The host range is the range of assignable IP addresses between the network address and the broadcast address. For /24, it's from .1 to .254.

What is the difference between total hosts and usable hosts?

Total hosts is the total number of addresses in the subnet (2^(32 - prefix)). Usable hosts is total hosts minus 2 (for the network and broadcast addresses).

Can I use a /31 subnet for point-to-point links?

Yes, /31 subnets provide 2 addresses (0 usable hosts traditionally). RFC 3021 allows /31 for point-to-point links, providing 2 usable addresses.

What is the purpose of CIDR?

CIDR was introduced to improve the efficiency of IPv4 address allocation and routing. It allows network administrators to allocate IP addresses more precisely, reducing waste and enabling route aggregation.

How do I calculate the CIDR prefix from a subnet mask?

Count the number of 1s in the binary representation of the subnet mask. For 255.255.255.0, the binary is 11111111.11111111.11111111.00000000, which has 24 ones, so the prefix is /24.

What is the difference between classful and CIDR addressing?

Classful addressing used fixed classes (A, B, C) with fixed subnet masks. CIDR allows variable-length subnet masks, making IP allocation more flexible and efficient.

What is VLSM and how does it relate to CIDR?

VLSM (Variable Length Subnet Mask) is the practice of using different subnet masks within the same network. It is enabled by CIDR and allows for more efficient use of IP space.

How do I use this calculator for subnetting?

Enter an IP address and CIDR prefix, and the calculator will show you the network address, broadcast address, host range, and all other details you need for subnet planning.

What is route summarization?

Route summarization (or supernetting) is the process of combining multiple routes into a single route advertisement. It reduces the size of routing tables and is made possible by CIDR.

Can this calculator handle IPv6?

This calculator is designed for IPv4 CIDR blocks. For IPv6, the principles are similar but the address length is 128 bits.

How accurate is this CIDR calculator?

This calculator provides accurate results based on standard CIDR and subnetting formulas. It handles all valid IPv4 address ranges and prefix lengths from 0 to 32.