Calculators.Life Calculator
Engineering

CIDR & Subnet Calculator

Input Parameters

Scenarios
Select or input an IPv4 address with CIDR prefix notation

Computed Results

Usable Hosts
254
Total Addresses256
Network Address192.168.10.0
Broadcast Address192.168.10.255
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
First Usable Host192.168.10.1
Last Usable Host192.168.10.254
IP ClassC

The CIDR & Subnet Calculator determines the network boundaries and host capacity for a given IPv4 address and CIDR prefix. It calculates the total number of addresses, usable hosts, subnet mask, wildcard mask, and the specific IP range from the first to the last usable host.

How the CIDR Calculation Works

Classless Inter-Domain Routing (CIDR) notation combines an IP address with a prefix length, representing the number of bits used for the network portion of the address. The remaining bits determine the number of available host addresses.

An IPv4 address consists of 32 bits. The total number of addresses in a subnet is calculated using the formula:

Total Addresses = 2^(32 − Prefix Length)

In most standard subnets, the first address is reserved to identify the network itself, and the last address is reserved as the broadcast address. Therefore, the number of usable hosts is typically calculated as:

Usable Hosts = Total Addresses − 2

There are exceptions for specific prefix lengths. A /32 prefix represents a single host address (1 usable host), and a /31 prefix is often used for point-to-point links, providing exactly 2 usable hosts with no dedicated network or broadcast addresses.

Subnet Calculation Examples

The following examples demonstrate how different CIDR prefixes affect the size and boundaries of a network.

Small Point-to-Point Link (/30)

A /30 subnet is commonly used for router-to-router connections. Using the input 10.0.0.0/30, the calculator determines:

Small Office Subnet (/28)

For a small network requiring a limited number of devices, a /28 prefix might be used. With the input 192.168.10.0/28, the results are:

Medium Network Block (/16)

Larger organizational networks often use a /16 prefix. Entering 10.0.0.0/16 yields:

Practical Use Cases

Understanding CIDR notation and subnet boundaries is essential for network design and management. Network administrators use these calculations to segment large IP blocks into smaller, manageable subnets, ensuring efficient use of available IP addresses. It helps in configuring routers, firewalls, and DHCP servers by providing the exact network address, broadcast address, and the range of IPs that can be assigned to devices.

Frequently Asked Questions

What is the difference between a subnet mask and a wildcard mask?

A subnet mask uses binary 1s to represent the network portion of an IP address and 0s for the host portion. A wildcard mask is the exact inverse, using 0s for the network portion and 1s for the host portion. Wildcard masks are frequently used in routing protocols and access control lists (ACLs).

Why are two addresses subtracted to find usable hosts?

In standard IPv4 subnets, the first address in the range is reserved as the network address, which identifies the subnet itself. The last address is reserved as the broadcast address, used to send data to all hosts on that subnet. These two addresses cannot be assigned to individual devices.

How does the calculator determine the IP Class?

The IP class is determined by the value of the first octet in the IPv4 address. For example, values from 1 to 126 indicate Class A, 128 to 191 indicate Class B, and 192 to 223 indicate Class C. CIDR allows for classless routing, but the traditional class designation is still identified based on this first octet.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.