CIDR Calculator

Convert an IPv4 address and CIDR prefix into its subnet mask, network, broadcast address, host range, and address capacity.

IPv4 subnet calculator
Enter any IPv4 host address and a prefix length from 0 through 32.

About the CIDR calculator

Classless Inter-Domain Routing, usually shortened to CIDR, represents an IPv4 network with an address followed by a slash and prefix length. A value such as 192.168.1.42/24 says that the first twenty-four bits identify the network and the remaining eight bits identify addresses inside it. This CIDR calculator accepts the address and prefix separately, then displays the boundaries and masks needed for network planning, firewall rules, routing tables, and troubleshooting. An IPv4 address contains thirty-two binary bits arranged as four decimal octets. The prefix determines how many leading bits are fixed. The calculator creates a subnet mask with that number of leading ones, performs a bitwise AND with the supplied address to find the network address, and sets every host bit to one to find the broadcast address. The wildcard mask is the bitwise inverse of the subnet mask and is commonly used by access-control lists and routing configurations. Total address capacity is two raised to the number of host bits. In a conventional subnet, the all-zero host address identifies the network and the all-one host address is the broadcast, leaving two fewer assignable host addresses. Prefixes /31 and /32 are special. A /31 is widely used for point-to-point links under RFC 3021, where both addresses can represent endpoints, while a /32 identifies one host route. The calculator therefore reports both addresses as usable for /31 and one for /32 rather than subtracting two. The usable range is shown from the first host through the last host. For ordinary prefixes, those are one address above the network and one below the broadcast. Remember that the displayed capacity describes address mathematics, not necessarily the number of devices your environment can support. Gateways, infrastructure, reserved addresses, DHCP exclusions, and cloud-provider policies can reduce practical capacity. IPv6 also uses CIDR prefixes, but its 128-bit addresses and notation require a dedicated IPv6 calculator; this tool intentionally validates IPv4 only. CIDR notation replaced rigid class A, B, and C network boundaries, allowing administrators to allocate address space in blocks that better match demand. Moving the prefix one bit higher halves the block, while moving it one bit lower doubles it. For example, a /24 has 256 total addresses and a /25 has 128. Use the calculator when dividing a larger allocation, checking whether two hosts share a subnet, documenting VPN routes, or translating an unfamiliar prefix into a dotted-decimal mask. Always confirm production changes against your organization's address plan before applying them.

CIDR calculation examples

Common private-network blocks illustrate how the prefix controls subnet size.

CIDR inputNetwork and capacityUse case
192.168.1.42/24192.168.1.0 to 192.168.1.255; 254 usableA typical small local network with a 255.255.255.0 mask.
10.20.30.40/810.0.0.0 to 10.255.255.255; 16,777,214 usableThe full private 10.0.0.0 block has a 255.0.0.0 mask.
172.16.5.130/26172.16.5.128 to 172.16.5.191; 62 usableA /26 divides a /24 into four blocks of 64 addresses.

How to use the CIDR calculator

  1. Enter an IPv4 address using four decimal octets separated by periods.
  2. Enter the CIDR prefix length as a whole number between 0 and 32.
  3. Select Calculate Subnet to derive the network boundaries and masks.
  4. Use the host range and capacity when planning assignments, routes, or firewall rules.

CIDR calculator FAQ

What does the number after the CIDR slash mean?

It is the count of leading address bits reserved for the network prefix. A larger number leaves fewer host bits and creates a smaller subnet.

Why are two addresses usually not usable?

The first address conventionally identifies the network and the final address is used for broadcast traffic. Ordinary IPv4 subnets therefore have two fewer assignable hosts than total addresses.

What is a wildcard mask?

A wildcard mask is the inverse of the subnet mask, with host bits shown as ones. Network devices often use it to match address ranges in access lists and routing statements.

Can this calculator process IPv6 addresses?

No, this tool validates dotted-decimal IPv4 addresses only. IPv6 uses 128-bit hexadecimal notation and requires different formatting and capacity handling.

Are /31 and /32 networks valid?

Yes, although they serve specialized purposes. A /31 is useful on point-to-point links, while a /32 commonly represents one exact host route.