IPv4 Subnet Calculator

Calculate network address, broadcast address, usable host range, wildcard mask, and address counts from an IPv4 block.

IPv4 CIDR planning Subnet math

Address Planning

Use CIDR, subnet mask, host count, or subnet count inputs to confirm exact network boundaries before documentation or configuration.

Network Broadcast Wildcard

What This Tool Does

This calculator explains the subnet result alongside the form so engineers, students, and administrators can see what the tool produces. Enter an IPv4 address, a CIDR prefix, or the related constraints shown in the form to calculate the network address, broadcast address, wildcard mask, host range, and address counts for a subnet.

That makes the page useful for engineers planning VLANs, administrators validating firewall objects, students learning binary subnetting, and support teams verifying whether a host falls inside the expected network. The calculation itself is deterministic, but the surrounding guidance explains when the raw math is enough and when local policy still matters.

Inputs explained

The network block field accepts a dotted IPv4 address, usually with CIDR notation such as 192.168.1.0/24. The subnet mask field provides an alternate way to express the same network bits. The host count and number of subnets inputs are planning aids that help derive a smaller subnet or split a larger one. Those values do not change the rules of IPv4; they simply help you choose the mask that fits your requirement.

How it works

The method follows standard IPv4 subnetting. The entered address is converted to a 32 bit value, the prefix determines which bits belong to the network, and the remaining bits define the host space. From there the tool calculates the first address in the block, the highest address in the block, the usable range in between, and the inverse mask often used in ACL syntax.

IPv4 Subnet Calculator

Enter CIDR (preferred). If no “/prefix”, you must provide a Subnet Mask or other constraints.
Pick a mask or leave blank and specify Hosts/Subnet or Number of Subnets.
Used to derive the smallest subnet that fits usable hosts.
Requires base prefix (from CIDR or mask) to split the block.

Step-by-Step Example

Use 192.168.10.14/27 as an example. A /27 prefix means the subnet mask is 255.255.255.224, leaving 5 host bits and creating blocks of 32 addresses. The address 192.168.10.14 falls inside the block that starts at 192.168.10.0 and ends at 192.168.10.31. That makes 192.168.10.0 the network address, 192.168.10.31 the broadcast address, and 192.168.10.1 through 192.168.10.30 the usable host range.

If you need ACL syntax, the wildcard mask is the inverse of the subnet mask, which is 0.0.0.31 in this case. If you need route or inventory documentation, the same result tells you the exact subnet boundary and host capacity with no ambiguity.

Use Cases

Use this page when you are validating subnet plans, writing firewall or router objects, documenting DHCP pools, checking migration worksheets, or reviewing whether an IP assignment belongs in the correct network. It is also useful during change reviews because a quick subnet calculation often reveals overlap, wasted space, or a mask mismatch before it becomes a production issue.

Assumptions and limitations

The output is a mathematical subnet result. It does not know your gateway reservation policy, FHRP virtual addresses, DHCP exclusions, point to point conventions, or cloud platform specific limits. Treat the calculation as an authoritative addressing baseline, then apply operational reservations and platform rules separately.

Frequently Asked Questions

How many usable hosts are in a /24 subnet?

A /24 subnet has 256 total IPv4 addresses because 2^(32 - 24) = 256. In traditional IPv4 subnetting, two are reserved: the network address and the broadcast address. That leaves 254 usable host addresses. For example, 192.168.1.0/24 usually gives hosts from 192.168.1.1 to 192.168.1.254, with 192.168.1.0 as the network and 192.168.1.255 as broadcast. Some special cases exist, such as /31 point-to-point links, but for CCNA-style LAN questions, 254 is the expected usable-host count.

How do I calculate the network address from IP and subnet mask?

To calculate the network address from an IP and subnet mask, perform a bitwise AND between the IP address and the mask. For example, 192.168.10.77 with mask 255.255.255.0 gives network 192.168.10.0. The mask keeps the network bits and clears the host bits. A calculator does this instantly, but students should understand the idea because it explains subnet boundaries. Once you know the network address, you can calculate the broadcast address, usable range, block size, and whether another IP belongs to the same subnet.

How do I find the broadcast address of a subnet?

The broadcast address is the last address in an IPv4 subnet. It is found by setting all host bits to 1. For example, in 10.1.2.0/24, the broadcast address is 10.1.2.255. In 10.1.2.64/26, the range is 10.1.2.64 to 10.1.2.127, so the broadcast is 10.1.2.127. Hosts normally do not use the broadcast address as an interface IP. It is used to reach all hosts on that subnet, which is why it must be kept separate from usable host addresses.

What is the subnet mask for /27?

The subnet mask for /27 is 255.255.255.224. A /27 leaves 5 host bits because 32 - 27 = 5, so each subnet has 2^5 = 32 total addresses. In the last octet, the block size is 256 - 224 = 32. That means /27 networks start at .0, .32, .64, .96, .128, .160, .192, and .224. Each normal /27 has 30 usable host addresses after excluding network and broadcast. This is a common size for small VLANs or device groups. It also appears often in exams.

How do I calculate a wildcard mask?

A wildcard mask is the inverse of a subnet mask. Subtract each subnet-mask octet from 255. For example, 255.255.255.0 becomes 0.0.0.255, and 255.255.255.224 becomes 0.0.0.31. Cisco ACLs and OSPF network statements often use wildcard masks to say which bits should be checked and which bits can vary. A 0 bit means match exactly; a 1 bit means ignore that bit. The calculator is useful because it removes mental mistakes when converting masks during configuration.

What is the first and last usable IP in a subnet?

The first and last usable IP addresses sit between the network address and the broadcast address. For example, 172.16.5.64/26 has a full range from 172.16.5.64 to 172.16.5.127. The first usable host is 172.16.5.65, and the last usable host is 172.16.5.126. The network address identifies the subnet, and the broadcast address reaches all hosts in that subnet. When configuring gateways, DHCP scopes, and static servers, use the usable range unless the platform documents a special exception.

How do I convert CIDR to subnet mask?

To convert CIDR to a subnet mask, count the number of 1 bits from the left. /24 means 24 network bits, so the mask is 255.255.255.0. /27 means 255.255.255.224. /30 means 255.255.255.252 and gives 4 total addresses, often used for point-to-point links in older designs. A simple shortcut is to focus on the octet where the prefix stops and calculate the block value. The calculator gives the mask, wildcard, host count, network, and broadcast together.

Sources & References

Related Tools

IPv4 Range to CIDR

Convert a start and end IP into the smallest covering CIDR set.

Compare IPv4 Subnets

Check whether two IPv4 networks overlap or contain one another.

Wildcard Mask Calculator

Translate a subnet mask into wildcard notation for ACL and routing work.