Checking…
Subnet calculator
Calculate IPv4 and IPv6 network ranges, address counts and masks. Everything is calculated in your browser.
Calculate IPv4 and IPv6 network ranges, address counts and masks. Everything is calculated in your browser.
Checking…
Enter an IPv4 or IPv6 address followed by a slash and a prefix length. For example, 192.168.1.10/24 identifies an address inside an IPv4 network, while 2001:db8::1/64 identifies an address inside an IPv6 prefix. The subnet calculator finds the containing network, its first and last address, and the total number of address values in that range. The subnet calculator works locally in your browser and does not scan or contact the network.
In the subnet calculator, the prefix length counts network bits from the left. IPv4 has 32 bits, so accepted prefixes run from /0 through /32. IPv6 has 128 bits, so they run from /0 through /128. A larger prefix length means fewer host bits and a smaller range. The subnet calculator accepts a host address as input; you do not need to replace it with the network boundary before calculating.
Try the example input and compare the result with a nearby prefix. With 192.168.1.10/24, the range begins at 192.168.1.0 and ends at 192.168.1.255. With /25, the same input falls into the lower half of that range. The subnet calculator changes the mask and counts accordingly. This is useful for checking a planned allocation before you change a router, firewall, or DHCP configuration.
Use four decimal octets for IPv4. Abbreviated values, octal-looking numbers, hexadecimal integers, ports, URLs, and interface zone identifiers are rejected. Those forms can be interpreted differently by different systems. The subnet calculator also asks you to use an ordinary IPv4 address and prefix for IPv4-mapped IPv6 inputs, rather than silently treating an IPv6 prefix as an IPv4 prefix. A clear input is easier to compare with router documentation.
The subnet calculator network field shows the normalized boundary plus the prefix. The first and last fields cover the complete mathematical range, including addresses that may have special meaning under the relevant protocol or link configuration. The total is the number of distinct address values, calculated as two raised to the number of remaining host bits. The subnet calculator preserves large IPv6 totals as exact integers rather than rounding them in floating-point arithmetic.
For IPv4, the subnet mask has its network bits set to one and its host bits set to zero. A wildcard mask reverses those bits. Some access-control systems use a wildcard mask, while other systems expect a prefix or subnet mask. Read the target system's documentation before pasting a result. A mathematically correct subnet calculator value can still be used in the wrong configuration field.
In a conventional IPv4 subnet with at least two host bits, the all-zero host value identifies the network and the all-one host value identifies the directed broadcast. Subtracting those two values gives the familiar usable-host count. For a /24, that is 254 addresses out of 256 total. The subnet calculator reports both figures so you can see which assumption is being applied.
The usable figure does not subtract your router, reserved DHCP leases, static assignments, or addresses you intend to keep free. Those are operational choices. If you need 254 client devices and one separate gateway address, a conventional /24 leaves too little room under that plan. Use the subnet calculator to establish the range, then build an allocation plan that accounts for infrastructure and future growth.
An IPv4 /31 contains two addresses. On a point-to-point link following RFC 3021, both can be used as endpoints. A /32 contains one address and is commonly used to describe a host route. The subnet calculator does not subtract two and return a negative or zero host count for these cases. Its /31 result assumes the point-to-point use case; verify that your equipment and intended link support it.
IPv6 uses different mechanisms, including multicast, rather than the IPv4 broadcast model. The subnet calculator therefore leaves broadcast and the conventional IPv4 usable-host count as not applicable for IPv6. The total remains useful as a mathematical measure. It is not a guarantee that every address in a prefix is suitable for assignment under every addressing plan, reservation, or protocol rule.
An IPv6 /64 has 64 host bits, and a /128 represents one address. A /127 has two address values and has a documented use on inter-router point-to-point links. A subnet calculator cannot decide whether a prefix is appropriate for a LAN that relies on automatic address configuration. Addressing architecture and device behavior matter in addition to the arithmetic.
A subnet calculator cannot tell whether a host is online, whether an address is allocated to your organization, or whether a firewall allows traffic. It does not inspect DHCP leases or detect duplicate addresses. It also cannot establish whether an internet provider will route a proposed prefix to you. The subnet calculator is local and deterministic, which is useful precisely because it does not depend on a live network response.
Private and documentation ranges are valid mathematical inputs. Calculating them does not make them publicly routable. The examples on this page use private IPv4 and documentation IPv6 space to avoid suggesting that you configure someone else's live allocation. For information about a public address's registered network, use the IP lookup. Keep that registration question separate from the subnet calculator's range calculation.
Suppose two departments are assigned ranges that overlap. Different names in a spreadsheet do not make those ranges distinct. Compare the first and last addresses, and verify that each proposed block falls on the appropriate prefix boundary. A subnet calculator helps you check each block, but it does not automatically inventory every existing route, VPN pool, container network, and remote site in your organization.
Overlaps are especially easy to miss when combining networks over a VPN. Two locations may independently use the same private range without problems until they need to communicate. Before renumbering, inventory dependent systems and plan the change. Use the subnet calculator as one source of evidence for that plan, not as a command to make immediate changes to production equipment.
You may have entered a host address rather than the range boundary. The subnet calculator clears the host bits to find the containing network. For 192.168.1.200/25, the network is 192.168.1.128/25, because the final octet lies in the upper block of 128 values. The result is normalization, not evidence that your device changed address.
Once this page and its code have loaded, the arithmetic runs in the browser. The subnet calculator does not submit your input to a calculation server. Loading or refreshing the website still requires a connection unless your browser already has the necessary resources. This distinction matters when working with internal network plans: the calculation itself does not need to contact those addresses.
They are related but not identical. In the subnet calculator, the IPv4 wildcard is the bitwise inverse of the subnet mask. For /24, the mask is 255.255.255.0 and the wildcard is 0.0.0.255. Some access-control syntaxes permit wildcard patterns that are not contiguous subnets. This tool calculates the contiguous CIDR case and does not validate every vendor's rule language.
IPv6 allocates a much larger address space than IPv4. A prefix that looks short on screen can represent an enormous range because the compressed notation hides zero groups, not bits. The subnet calculator displays the exact total so you can distinguish it from a rounded estimate. Plan IPv6 networks according to routing and address-configuration requirements instead of trying to fill every possible host value.
For a step-by-step derivation, read CIDR notation explained. Its worked IPv4 and IPv6 examples show how the subnet calculator obtains boundaries, why block alignment matters, and how to interpret the exceptional prefix lengths.
CIDR is described in RFC 4632. The point-to-point IPv4 exception is specified in RFC 3021, and IPv6 inter-router /127 use in RFC 6164. Consult your device documentation alongside these references. A subnet calculator verifies arithmetic; a successful network change also requires a correct operational plan.
For an interval with arbitrary endpoints, a list of networks to combine, or a parent to divide, use the CIDR calculator. Keep this subnet calculator for masks and single-prefix host boundaries. The two tools answer different planning questions: a subnet calculator explains one block, while range conversion and aggregation preserve the exact coverage of a larger input.