CIDR Calculator

Calculate IP address ranges, subnet masks, and network information using CIDR notation for network planning and management.

Calculate Your CIDR Calculator

/

What is CIDR Notation?

CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses and their associated routing prefix. It was introduced in 1993 to replace the earlier classful network addressing architecture, allowing for more efficient allocation of IP addresses and better route aggregation.

CIDR notation consists of an IP address followed by a slash (/) and a number that indicates how many bits are in the network portion of the address. For example, 192.168.1.0/24 indicates that the first 24 bits of the address represent the network, leaving 8 bits for host addresses.

Understanding IP Addressing

An IPv4 address consists of 32 bits, typically represented as four octets (bytes) separated by dots. Each octet represents 8 bits and can range from 0 to 255. For example, 192.168.1.1 is a typical IP address.

Binary Representation

IP addresses are fundamentally binary:

192.168.1.1 in binary is:
11000000.10101000.00000001.00000001

Network and Host Portions

CIDR divides an IP address into:

  • Network portion: Identifies the network
  • Host portion: Identifies specific devices on that network

CIDR Notation Explained

In CIDR notation, the prefix length after the slash specifies how many bits are used for the network portion:

CIDR NotationSubnet MaskTotal AddressesUsable Addresses
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

For example, in 192.168.1.0/24:

  • The first 24 bits (192.168.1) represent the network address
  • The remaining 8 bits (0-255) represent host addresses on that network
  • This gives 256 total addresses (2^8), with 254 usable addresses (excluding network and broadcast addresses)

Key CIDR Calculations

Total Addresses in a Subnet

TotalAddresses=2(32prefix)Total Addresses = 2^(32 - prefix)

For a /24 network: 2^(32-24) = 2^8 = 256 addresses

Usable Addresses

UsableAddresses=2(32prefix)2Usable Addresses = 2^(32 - prefix) - 2

We subtract 2 to account for the network address (first address) and broadcast address (last address)

Subnet Mask Calculation

A subnet mask consists of consecutive 1s for the network portion followed by 0s for the host portion.
For a /24 prefix, the subnet mask is:
11111111.11111111.11111111.00000000
Which translates to 255.255.255.0

Special Addresses

  • Network Address: First address in the range (all host bits set to 0)
  • Broadcast Address: Last address in the range (all host bits set to 1)
  • First Usable Address: Network address + 1
  • Last Usable Address: Broadcast address - 1

Private IP Ranges

  • 10.0.0.0/8 - Large networks (16,777,214 hosts)
  • 172.16.0.0/12 - Medium networks (1,048,574 hosts)
  • 192.168.0.0/16 - Small networks (65,534 hosts)
  • 169.254.0.0/16 - Link-local addresses (APIPA)

CIDR in Network Design

Subnetting

CIDR allows networks to be divided into subnets of varying sizes, optimizing address allocation and improving network organization. Each subnet can be sized appropriately for its intended use.

Network Segmentation

Proper subnetting enhances security by isolating network segments and controlling traffic flow between them. This is particularly important for separating sensitive systems from general-purpose networks.

Route Aggregation

CIDR enables route summarization, allowing multiple network routes to be represented by a single routing table entry. This reduces routing table size and improves network performance.

CIDR Notation Examples

Common CIDR blocks and their uses:

  • /32 - Single host address

    Example: 192.168.1.10/32 (just one IP)

  • /30 - Point-to-point links

    Example: 192.168.1.0/30 (4 IPs, 2 usable)

  • /29 - Very small subnet

    Example: 192.168.1.0/29 (8 IPs, 6 usable)

  • /24 - Small local network

    Example: 192.168.1.0/24 (256 IPs, 254 usable)

  • /16 - Large organization network

    Example: 192.168.0.0/16 (65,536 IPs)

  • /8 - Massive network

    Example: 10.0.0.0/8 (16,777,216 IPs)

Frequently Asked Questions

CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses and their routing prefix. It consists of an IP address followed by a slash (/) and a number that indicates how many bits are in the network portion. For example, 192.168.1.0/24 means the first 24 bits are the network portion, leaving 8 bits for host addresses.

To calculate usable IP addresses in a subnet, use the formula: 2^(32-prefix) - 2. The subtraction of 2 accounts for the network address and broadcast address. For example, a /24 subnet has 2^(32-24) - 2 = 2^8 - 2 = 256 - 2 = 254 usable addresses. Our calculator performs this calculation automatically.

A subnet mask (like 255.255.255.0) and CIDR prefix (/24) represent the same thing but in different formats. The subnet mask uses dotted-decimal notation showing which bits are part of the network address (255) versus host address (0). The CIDR prefix simply counts how many '1' bits are in the subnet mask, providing a more compact notation.

To find the network address: perform a bitwise AND operation between the IP address and subnet mask. To find the broadcast address: take the network address and set all host bits to 1. Example for 192.168.1.10/24: Network address: 192.168.1.0, Broadcast address: 192.168.1.255. Our calculator provides these addresses automatically when you enter an IP address and prefix.

Common private network CIDR blocks defined by RFC 1918 include: 10.0.0.0/8 (10.0.0.0 - 10.255.255.255): Large networks with millions of addresses; 172.16.0.0/12 (172.16.0.0 - 172.31.255.255): Medium-sized networks; 192.168.0.0/16 (192.168.0.0 - 192.168.255.255): Small networks. These private ranges can be further divided into smaller subnets as needed.

Share This Calculator

Found this calculator helpful? Share it with your friends and colleagues!