b2KIT

IP Subnet Calculator

Calculate subnet masks, CIDR notation, network address, broadcast address, and host ranges for IPv4/IPv6.

Tested tool guide Tested browser tools Checked August 16, 2026

What IP Subnet Calculator does, with a checked example

Given an IPv4 or IPv6 address with a prefix length, IP Subnet Calculator identifies the containing subnet and expresses its mask, network address, and address span. For IPv4, it also determines the broadcast address and the conventional usable host range between the network and broadcast values. The common surprise is that the entered address need not be the network address. The calculator clears its host bits to find the subnet boundary. IPv6 has no broadcast address, so that IPv4 result does not apply to an IPv6 prefix.

Worked example

A concrete input and expected output from the current implementation.

Input

192.168.1.130/26

Expected output

Subnet mask: 255.255.255.192
Network CIDR: 192.168.1.128/26
Network address: 192.168.1.128
Broadcast address: 192.168.1.191
Usable host range: 192.168.1.129 - 192.168.1.190

A /26 leaves 6 host bits, so each block contains 2^6, or 64, addresses. The block containing 130 runs from 128 through 191; excluding those two IPv4 boundary addresses leaves 129 through 190, which is 62 conventional host addresses.

How the result is produced

1

IPv4 block calculation

An IPv4 /n prefix assigns the first n of 32 bits to the network. Its subnet mask therefore has n leading 1 bits followed by 0 bits. Clearing the address's host bits gives the lowest address in the block. Setting every host bit to 1 gives the highest address, conventionally treated as the subnet's directed broadcast address.

2

IPv6 prefix calculation

For IPv6, the prefix length divides a 128-bit address into prefix and remaining bits. Clearing or setting the remaining bits establishes the numerical endpoints covered by that prefix: the lowest and highest addresses whose leading bits match the prefix. These endpoints describe the prefix range. They must not be interpreted as IPv4-style network and broadcast reservations because IPv6 does not define broadcast addresses.

Good uses

  • Check whether a server address and its proposed gateway fall within the same IPv4 subnet before investigating routing or firewall behavior.
  • Find the network, broadcast, and conventional usable-address boundaries needed when planning an IPv4 DHCP pool or documenting a static-address allocation.
  • Expand an IPv6 allocation such as 2001:db8:1200::/56 into its covered address range and confirm how a proposed address relates to that prefix.

Limits and checks

  • A calculated range describes address arithmetic, not actual reachability. VLAN boundaries, routes, firewall rules, duplicate addresses, and interface configuration can still prevent communication between addresses in the same calculated subnet.
  • The conventional IPv4 host range is not universal for /31 and /32 prefixes. RFC 3021 permits both addresses of a /31 on applicable point-to-point links, where the ordinary network-and-broadcast exclusion does not apply.
  • An IPv6 range can contain an extremely large number of values. Its numerical endpoints do not imply that every value is assigned, usable by a host, or available under an organization's allocation policy.

Common questions

Why is the network address different from the IP address I entered?

The entered IP may be any address inside the subnet. Its prefix determines which leading bits identify the network and which remaining bits vary within the block. Clearing the varying bits produces the network address. Consequently, 192.168.1.130/26 belongs to 192.168.1.128/26 even though the entered address itself ends in 130.

Does an IPv6 subnet have a broadcast address?

No. The IPv6 addressing architecture defines unicast, anycast, and multicast addresses, but no broadcast address. IPv6 uses multicast for purposes that would commonly involve broadcast in IPv4. Treat an IPv6 prefix's upper endpoint only as the greatest numerical address covered by the prefix, not as a broadcast address or an automatically reserved equivalent.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools