Subnet Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Understanding IPv4 Subnetting and CIDR Prefixes

This IPv4 subnet calculator separates an address into its network bits and host bits. The CIDR prefix, written with a slash such as /24, states how many of the address's 32 bits identify the network. A /24 therefore leaves eight bits available within that subnet's address range. Entering an address and prefix lets the calculator identify the network address, broadcast address, and assignable-host information for that exact range.

Subnetting divides a larger IPv4 allocation into smaller, clearly bounded networks. Administrators use those boundaries when assigning addresses, setting interface addresses, writing routes, and checking whether two devices belong to the same broadcast domain. Deliberate subnet boundaries can also support segmentation and make an address plan easier to understand. The calculator is a quick way to inspect the consequences of a chosen prefix without manually converting every octet to binary.

IPv4 Subnet Details Shown by the Calculator

For the IPv4 address and prefix you enter, the subnet calculator returns several address-planning values. The network address is the first address in the block and labels the subnet. The broadcast address is the final address in the block. For prefixes from /1 through /30, the result also identifies the first and last addresses between those endpoints and counts them as usable hosts. These fields make it easier to reserve an appropriate range for interfaces, servers, or other addressed devices.

Viewing the boundary addresses together is useful when reviewing a proposed allocation. Changing only the prefix changes the size of the block and can move both boundaries, even when the typed IPv4 address stays the same. That makes the output particularly useful for checking whether an intended device address falls within a planned subnet and for recording the resulting range in a network design.

Formula: IPv4 Network and Broadcast Address Calculation

This subnet calculator converts the dotted IPv4 address into a 32-bit value and creates a 32-bit mask from the selected prefix. A bitwise AND of the address and mask produces the network address. The broadcast address uses the same network bits with every host bit set to one. The browser performs these bitwise operations directly when you select Calculate.

The usable-host count shown here is based on the host bits left after the prefix. For prefixes /1 through /30, the calculator subtracts the network and broadcast addresses from the total size of the block. For /31 and /32, this page reports zero usable hosts and shows N/A for the first and last host fields, while still displaying the calculated network and broadcast addresses. The calculator accepts prefix values from 1 through 32.

How to use: Verify an IPv4 Address and Prefix

To check an IPv4 subnet, type a four-octet IPv4 address in the IP Address field and enter its CIDR prefix in the Prefix field. Select Calculate to see the network boundary, broadcast boundary, usable-host count, and host endpoints produced by that combination. This is helpful when confirming an interface setting, reviewing a subnet assigned to a VLAN, or checking a range before adding it to a configuration.

Subnet arithmetic is easy to misread when several prefixes are in use at once. Comparing the returned network and broadcast addresses with the ranges already allocated in your design can reveal an overlap or an unexpectedly large block. Students can also use the result to check a manual binary calculation and then trace how the selected prefix affected the range.

Planning IPv4 Address Space with Subnets

IPv4 subnet planning starts with matching a prefix length to the address range a network needs. A shorter prefix leaves more host bits and creates a larger block; a longer prefix creates a smaller block. The subnet calculator lets you try candidate prefixes against a specific address so that the actual network and broadcast boundaries, rather than only a memorized table, guide the decision.

For example, separate networks for infrastructure, users, guests, or lab equipment may need distinct address ranges. Calculating each range before configuring devices helps keep the allocations separate and makes later troubleshooting more direct. Small subnets can suit tightly scoped links or services, while larger subnets may be appropriate where more endpoints must share the same IPv4 network. The right choice depends on the topology and addressing plan.

Using IPv4 Subnet Results in Network Workflows

This browser-based IPv4 subnet calculator can serve as a reference while preparing router, firewall, switch, or host settings. The network and broadcast values provide a concise check on the boundaries implied by an address and prefix, and the first and last host values provide a quick view of the ordinary assignable range for /1 through /30 subnets.

When documenting a network, record the address, prefix, network address, and intended purpose of each subnet together. Checking those details before deployment can prevent an address from being placed in the wrong block. The calculator's output is best used alongside the actual addressing plan and device configuration, especially where routing, reservations, or organization-specific conventions affect how addresses are assigned.

Learning IPv4 Subnet Masks and Host Bits

For learners, this subnet calculator makes the relationship between a CIDR prefix and an IPv4 range visible. Try the same address with several prefixes and observe how the network address, broadcast address, and host count change. That experiment reinforces that the prefix fixes the network portion of the address and leaves the remaining bits to enumerate addresses inside the block.

The output can complement, rather than replace, learning the binary method. Converting an octet to binary explains why a mask rounds a network boundary to a particular value and why the broadcast address ends with host bits set to one. Once that pattern is familiar, the calculator offers a fast check for exercises, lab plans, and real configuration reviews.

IPv4 Subnetting Checks Before Deployment

An IPv4 subnet result is most valuable when it is compared with the network you intend to configure. Confirm that the entered address is the correct device or candidate address, that the prefix matches the planned mask, and that the reported network does not conflict with another allocation. Also verify whether a particular address is reserved by your own addressing policy before assigning it.

This calculator focuses on the numeric IPv4 range derived from one address and prefix. It does not configure equipment, validate routes, discover devices, or determine whether an address is already in use. Treat the displayed boundaries as a calculation aid and validate the final deployment against current network documentation and the configuration requirements of the devices involved.

Worked example: IPv4 Address 192.168.10.37 with a /27 Prefix

For an IPv4 address of 192.168.10.37 with prefix /27, the calculator returns network 192.168.10.32 and broadcast 192.168.10.63. It reports 30 usable hosts, with 192.168.10.33 as the first host and 192.168.10.62 as the last host. The /27 prefix leaves five host bits, creating a 32-address block; the network and broadcast endpoints are not included in the displayed usable-host count.

Limitations and assumptions for IPv4 Subnet Results

This calculator derives IPv4 network boundaries from the address and CIDR prefix you provide; it is not a full inventory or configuration audit. Accurate results require a valid IPv4 address and the intended prefix, and the output should be compared with your current address plan. It cannot account for site-specific reservations, routing design, device behavior, or policies that may govern how an otherwise valid address range is used.

Enter IP and prefix.

Arcade Mini-Game: Subnet Calculator Calibration Run

Use this quick arcade run to practice separating useful scenario inputs from common planning mistakes before you rely on the calculator output.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.