IP Subnet Calculator: Calculate IPv4 CIDR and Host Ranges

Calculate IPv4 subnet details from an IP address and CIDR prefix. See the subnet mask, network, broadcast, usable host range, total hosts, wildcard mask, and binary values.

What This IPv4 Subnet Calculator Calculates

An IPv4 subnet calculator translates an address and CIDR prefix into the boundaries of the network that contains it. Enter an IPv4 address, choose a prefix from /1 through /32, and the tool calculates the subnet mask, wildcard mask, network address, broadcast address, first and last usable IP, total addresses, usable hosts, and binary representations.

This is a subnet calculation workflow, not an arbitrary start-and-end range checker. You begin with one IP and the size of its network prefix, then the calculator applies that prefix to discover the correct block. That makes it useful when you have an interface address and need to know its network, host capacity, or broadcast boundary before configuring a VLAN, DHCP scope, route, or access rule.

Enter an IPv4 Address and CIDR Prefix

Type a valid IPv4 address such as 192.168.1.73 and select a CIDR prefix from the list. The prefix length tells the calculator how many of the 32 bits belong to the network portion; the remaining bits identify addresses inside that subnet. A shorter prefix creates a larger block, while a longer prefix creates a smaller block with fewer possible host addresses. The current tool validates IPv4 input and accepts prefix values from /1 to /32.

The address you enter does not have to be the network address. For example, with 192.168.1.73/26, the calculator applies the /26 mask and places the address in the block beginning at 192.168.1.64. Changing the prefix to /24 produces a different network beginning at 192.168.1.0. This is why entering the correct prefix matters more than entering a visually neat address. The page does not accept IPv6, dotted-decimal masks, or a separate subnet-splitting request.

Read Network, Broadcast, and Usable Host Results

The network address is the first address in the calculated block, where all host bits are zero. The broadcast address is the last address, where all host bits are one, for ordinary IPv4 subnet behavior. For 192.168.1.73/26, the block contains 64 total addresses from 192.168.1.64 through 192.168.1.127. The first usable host is normally 192.168.1.65, and the last usable host is 192.168.1.126.

Total addresses follow the IPv4 formula 2^(32 - prefix). In a conventional subnet, usable hosts are usually the total minus the network and broadcast addresses, so a /24 has 256 total addresses and 254 usable hosts. This calculator handles the common edge cases separately: a /31 reports both addresses as usable for a point-to-point link, while a /32 represents one host and reports one usable address. Always compare the result with the platform or carrier rules that will actually assign the addresses.

Keeping the two counts separate prevents a common planning error. A /27 contains 32 total addresses but normally provides 30 host addresses after the network and broadcast endpoints are excluded. A DHCP scope, cloud platform, or VPN service may reserve still more addresses for its own infrastructure. The calculator reports the standard IPv4 arithmetic; it cannot know the local provider policy unless you apply that policy yourself.

Understand Masks, Wildcards, and Binary Output

The subnet mask is the dotted-decimal form of the prefix. A /24 becomes 255.255.255.0; it keeps the first 24 bits as the network portion and leaves eight host bits. The wildcard mask is the bitwise inverse of that mask, so the same /24 produces 0.0.0.255. Wildcard values are commonly useful when reading ACLs and routing policy syntax, but the calculator does not apply a rule or test whether a device accepts it.

Binary output makes the boundary visible instead of hiding it inside four decimal octets. The result shows the entered IP, its subnet mask, and the calculated network address in binary, which can help students check subnetting work or administrators inspect an unusual prefix. The IP class and private/public label provide additional context, but classful labels are historical and the private check is not a complete routing or ownership decision. A public label does not prove that an address is reachable, and a private label does not make a configuration automatically safe.

Conceptually, the network address is found by applying a bitwise AND between the IP and mask. The host bits are cleared to zero, while the broadcast address sets those host bits to one. Seeing the three binary values together is useful when a prefix cuts through an octet, such as /20 or /27, because the decimal boundary is less obvious than it is for /8, /16, or /24.

Apply Subnet Results to Real Network Decisions

Use the calculator when designing a small office LAN, documenting a VLAN, reviewing a cloud network, checking a DHCP scope, or preparing a firewall and router rule. Start with the IP and prefix supplied by the network design, then compare the calculated network and broadcast values with the intended segment. The usable host count helps estimate capacity, while the first and last usable addresses show the normal assignment boundaries. If a gateway is needed, choose it according to the local convention; the calculator does not decide or verify a gateway.

It is also useful during troubleshooting. If a device appears outside the expected subnet, check its prefix before blaming DNS or routing. A different prefix can move the network boundary even when the IP address stays the same. Do not confuse this result with an IP range calculator: a subnet calculator derives one structured block from an IP and prefix, while a range calculator counts an explicitly supplied start and end interval. This page does not test reachability, split a block into child subnets, reserve provider-specific addresses, or prove that a firewall policy is correct.

For a site-to-site VPN or managed network, the calculated block can also expose overlap before a connection is deployed. Two locations using the same private subnet may route unpredictably even when each local configuration works by itself. Compare the network address and prefix with the other side, then confirm the plan in the equipment or service documentation. The calculator highlights the arithmetic boundary; it does not detect conflicts across networks.

Before using a result in production, verify the address family, prefix length, and intended network role. Check whether your operating system, cloud provider, VPN, or carrier reserves additional addresses beyond the usual network and broadcast rules. For learning, compare the displayed mask and binary boundary with a manual calculation. For operations, compare them with the source design or device configuration. That final check turns a fast subnet mask calculation into a dependable planning step rather than an unexplained number copied into a change request.

Frequently Asked Questions

How do I calculate a subnet from an IP address and CIDR?