Free network utility

IPv4 Subnet Calculator

Calculate network, broadcast, usable host range, netmask, and wildcard mask from IPv4 CIDR notation.

What this IPv4 subnet calculator returns

Enter an IPv4 host address followed by a CIDR prefix, such as 192.168.1.130/26, or an address followed by a contiguous dotted subnet mask. RouterNAT identifies the entered address role and common scope, normalizes the containing network, calculates the directed broadcast or specialized endpoint behavior, first and last conventional host, subnet and wildcard masks, network and host bits, total and usable capacity, boundary increment, adjacent aligned networks, and decimal, hexadecimal, and binary representations. The calculation runs entirely in the browser. It does not scan the network, discover occupied addresses, contact a router, or prove that a proposed range is available.

An address and prefix must be interpreted together

An IPv4 address by itself identifies one 32-bit value, while a prefix defines how many leading bits belong to the network. The same address can sit in very different blocks under /16, /24, /26, or /32. For example, 192.168.1.130/24 belongs to 192.168.1.0/24, but 192.168.1.130/26 belongs to 192.168.1.128/26. Do not infer a modern subnet mask from historical class A, B, or C labels. CIDR permits boundaries at any bit from /0 through /32. RouterNAT accepts the concrete address and mask together so it can calculate the containing aligned block rather than assuming the entered value is already a network address.

How the network address is calculated

The subnet mask contains leading one bits for the network and trailing zero bits for hosts. A bitwise AND between the 32-bit entered address and mask preserves the network bits and clears every host bit. With 192.168.1.130/26, the /26 mask is 255.255.255.192. In the last octet, decimal 130 is binary 10000010 and mask 192 is 11000000. Their AND is 10000000, or 128, producing network 192.168.1.128/26. The operation works across octets and large ranges exactly the same way. The binary table exposes the calculation and prevents decimal appearance from hiding the actual boundary.

How the broadcast and host range are calculated

For a conventional IPv4 subnet from /0 through /30, the directed broadcast is found by keeping the network bits and setting every host bit to one. The first conventional host is network plus one; the last is broadcast minus one. For 192.168.1.128/26, the block contains 64 addresses through .191, so .128 identifies the network, .191 is broadcast, and .129 through .190 are conventional hosts. Network and broadcast are the first and last values of that specific block, not always addresses ending in .0 and .255. A /20, /23, /27, or /29 can begin and end at less familiar octet values.

CIDR prefix and dotted subnet mask

CIDR writes the number of network bits after a slash. A /26 uses 26 one bits and six zero bits, producing dotted mask 255.255.255.192. A /20 produces 255.255.240.0. Valid modern masks are contiguous: once a zero bit appears, no later bit can be one. A value such as 255.0.255.0 cannot represent one CIDR prefix and is rejected. Dotted masks are configuration representations, not separate addressing systems. When copying between a router, firewall, cloud console, spreadsheet, or command line, preserve whether the field expects a prefix length, subnet mask, or wildcard rather than pasting any dotted value that looks address-like.

Wildcard masks invert subnet masks

A wildcard mask is the bitwise inverse of a subnet mask. The inverse of 255.255.255.192 is 0.0.0.63. In common ACL or routing syntax, a zero wildcard bit requires the corresponding address bit to match, while a one permits variation. A wildcard is not a second subnet mask and should not be pasted into an interface netmask field. Some platforms support non-contiguous wildcard expressions for selected-bit matching; those patterns do not map to one CIDR block. RouterNAT reports only the contiguous inverse associated with the entered prefix. Confirm the target vendor's command semantics because source, destination, host, subnet, and inverse-mask fields can use different notation.

Block increment and boundary octet

When a prefix ends inside an octet, subtract the mask value in that octet from 256 to obtain the block increment. A /26 ends with mask octet 192, so the increment is 64 and last-octet network boundaries are 0, 64, 128, and 192. A /20 has third-octet mask 240, giving increment 16 and boundaries where the third octet is 0, 16, 32, and onward. Find which interval contains the entered address; the interval start is the network and the next boundary minus one is broadcast. The output states the boundary octet and increment so manual calculations can be checked rather than replaced by an unexplained result.

Previous and next aligned networks

Equal-size subnets are consecutive when their boundaries are correct. The network immediately before the current block starts one block size lower; the next starts at the current broadcast plus one. For 192.168.1.128/26, adjacent /26 networks are 192.168.1.64/26 and 192.168.1.192/26. These values help review an address plan, but they do not prove that adjacent space belongs to the same organization, parent allocation, VLAN, cloud network, or route. At the edges of IPv4 space, a previous or next block may not exist. Verify ownership and parent containment before extending a pool or creating another subnet based on mathematical adjacency.

Total addresses and usable-host capacity

A prefix with h host bits contains two raised to h total addresses. A /24 leaves eight host bits and contains 256 values; a /26 leaves six and contains 64; a /29 leaves three and contains eight. Conventional usable-host capacity subtracts network and broadcast for prefixes through /30. This arithmetic does not equal practical client capacity. Gateways, redundancy virtual addresses, servers, reservations, manually configured infrastructure, DHCP exclusions, cloud-provider reservations, future growth, and operational policy consume space. Wireless client capacity depends on airtime and RF design rather than the number of available IPs. Use the calculated capacity as a boundary fact, then build an explicit allocation plan.

Why /31 is a specialized exception

RFC 3021 permits both addresses of a /31 on a compatible IPv4 point-to-point link. Because the link has only two endpoints and no conventional multi-access broadcast requirement, the ordinary subtract-two rule is not applied. RouterNAT reports two usable endpoints and labels broadcast as unused for that model. A /31 is not an appropriate shortcut for a Wi-Fi network, Ethernet client VLAN, shared server segment, or ordinary DHCP pool. Both devices and routing protocols must support the point-to-point behavior, and monitoring and documentation must understand it. Confirm platform requirements before replacing a conventional /30 on infrastructure links.

Why /32 identifies one exact address

A /32 uses all 32 bits as the prefix and leaves no varying host bits. It represents one address or host route, commonly used for loopbacks, policy objects, tunnel endpoints, or a route toward a single destination. It has subnet mask 255.255.255.255 and wildcard 0.0.0.0. A /32 does not describe an ordinary LAN with a separate network, broadcast, gateway, and DHCP pool. Some interface configurations use a /32 with explicit peer or route information, but that is platform context rather than a general multi-access design. RouterNAT reports the entered value as the host route and avoids inventing a conventional broadcast range.

Address scope is separate from subnet math

An internally consistent subnet can still use an address with special scope. RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Provider shared space is 100.64.0.0/10. Loopback is 127.0.0.0/8, link-local includes 169.254.0.0/16, and multicast occupies 224.0.0.0/4. Documentation and other reserved blocks have additional purposes. Classification does not determine ownership, safety, or reachability. A public-looking value must still be allocated and routed to the user, while a private network can overlap a VPN, container platform, cloud VPC, or another site and cause routing ambiguity.

From a subnet result to a DHCP pool

The calculated usable interval is the outer mathematical host range, not an instruction to offer every address dynamically. Select and document the gateway, infrastructure band, manually configured devices, reservations, exclusions, dynamic pool, and future allocation. Keep the router address and static devices outside unrestricted dynamic offers or protect them using the DHCP server's supported model. Verify that start and end belong to the same subnet and do not include network or broadcast. A valid range cannot detect a second DHCP server, stale leases, duplicate manual addresses, wrong options, missing VLAN relay, or a vendor rule requiring reservations inside or outside the displayed pool.

VLANs, routing, and overlap

Each routed VLAN normally has a unique IP subnet and gateway. The subnet calculation does not create the VLAN, trunk tag, switch port, interface, DHCP relay, firewall policy, or route. Two different VLANs using overlapping ranges cannot communicate unambiguously through ordinary routing. Site-to-site VPNs, remote-access pools, containers, hypervisors, cloud networks, and vendor defaults frequently reuse familiar private blocks, so a locally unused-looking range can still overlap a remote destination. Compare proposed networks against authoritative route tables, IPAM, firewall objects, VPN selectors, cloud inventories, and future designs. Ping failure is not proof that a block is free or owned.

Worked example for 172.16.35.70/20

A /20 mask is 255.255.240.0, leaving 12 host bits and a third-octet increment of 16. The third octet 35 falls inside the interval beginning 32 and ending 47. Therefore the containing network is 172.16.32.0/20 and broadcast is 172.16.47.255. Conventional hosts range from 172.16.32.1 through 172.16.47.254. The block contains 4,096 total addresses and 4,094 conventional hosts. The previous aligned /20 begins at 172.16.16.0 and the next at 172.16.48.0. Although the entered address begins 172.16.35, its network is not 172.16.35.0 because the prefix boundary lies four bits into the third octet.

Worked example for 192.168.10.77/27

A /27 mask is 255.255.255.224 and the last-octet increment is 32. Boundaries are .0, .32, .64, .96, .128, .160, .192, and .224. Address .77 falls in the .64 through .95 interval. The network is 192.168.10.64/27, broadcast is .95, and conventional hosts are .65 through .94. Five host bits give 32 total values and 30 conventional hosts. The entered .77 is an ordinary host, not the network or broadcast. This example shows why memorizing that private networks always begin .0 and end .255 produces incorrect results once a /24 is divided into smaller subnets.

Planning, change control, and limitations

Use the result to document and review a design, not as proof that a live address can be assigned. Inventory current gateways, DHCP scopes, reservations, static devices, routes, VPNs, VLANs, cloud networks, monitoring, DNS, and firewall policy. Back up the relevant configurations and schedule disruptive renumbering. Apply one controlled change, test an authorized client, verify address, mask, gateway, DNS, local routing, remote routing, and applications, and retain a rollback path. RouterNAT cannot discover occupied addresses, validate ownership, inspect route selection, identify a rogue DHCP server, or authorize a production change. Entered values stay in browser memory and need not contain credentials or confidential inventory.

When one network must be divided for several departments or device groups, use the VLSM subnet planner. To verify a proposed router address and address pool, run the result through the DHCP range validator.

For a quick prefix-only reference, open the CIDR and subnet mask converter. The IPv4 decimal and binary converter is useful when studying individual address bits.

If device demand should choose the prefix rather than checking an existing address, use the network host calculator. Then turn the approved block into a controlled scope with the DHCP range calculator.

Document gateway, servers, access points, cameras, and other predictable assignments with the static IP and reservation planner after the subnet and DHCP ownership are approved.

Privacy and responsible use

This calculation runs locally in your browser. RouterNAT does not receive or save the values entered into this tool. Use the result only for lawful network administration and troubleshooting.

How to use this result

Verify important changes against your router manual, ISP documentation, or an authorized network administrator. This utility provides planning guidance and does not connect to, scan, or modify your router.

Comments

Leave a Comment

Your email address will not be published. Comments are reviewed before appearing.