Skip to content

IPv6 Subnet Calculator

Calculate an IPv6 network prefix, canonical address, first and last numeric address, host bits, and exact range size locally.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Enter a pure IPv6 address using expanded or one-double-colon compressed syntax.
  2. 2.Enter an integer prefix length from 0 through 128 and select Calculate subnet.
  3. 3.Review the canonical input, network prefix, numeric first and last addresses, and exact address count before using the result in documentation or configuration.

About IPv6 Subnet Calculator

IPv6 Subnet Calculator converts an IPv6 address and prefix length into an auditable 128-bit numeric range. It reports the RFC 5952 canonical form of the input, the network prefix, the first and last addresses in the range, the number of host bits, and the exact count of addresses. Calculations use browser BigInt arithmetic, so even a /0 range is represented without floating-point loss.

IPv6 addresses contain eight 16-bit hexadecimal fields for a total of 128 bits. RFC 4291 permits leading zeroes inside a field to be omitted and allows one double colon to replace one or more consecutive zero fields. This tool accepts those conventional pure-IPv6 forms, expands them to eight fields internally, converts the address to one 128-bit integer, and applies the selected prefix mask.

The network address is the input value with all host bits cleared. The last numeric address is the network value with every host bit set. Address count is 2 raised to the number of host bits. For the RFC example address 2001:0DB8:0:CD30:123:4567:89AB:CDEF with prefix 60, the network is 2001:db8:0:cd30::/60 and the last address is 2001:db8:0:cd3f:ffff:ffff:ffff:ffff.

Output follows RFC 5952 recommendations. Hexadecimal letters are lowercase, leading zeroes are removed, the longest run of two or more all-zero fields is compressed, and the first run wins when equal-length runs tie. A single zero field is not compressed. Eight external text fixtures cover expanded, compressed, loopback, unspecified, multicast, tie, single-zero, and maximum-value forms.

Prefix length must be an integer from 0 to 128. A /128 contains one address. A /64 contains 2⁶⁴ numeric values. A /0 covers the full 128-bit address space. The terms first and last describe numeric bounds only. IPv6 does not use an IPv4-style broadcast address, and the last value is not labeled broadcast.

The calculator deliberately excludes zone identifiers such as %eth0 and IPv4-embedded dotted-decimal forms. Those syntaxes require additional interface or mixed-address context and are rejected with a clear error instead of being partially interpreted. The page also does not decide whether a prefix is on-link, routable, globally assigned, reserved, multicast, anycast, or appropriate for SLAAC.

A numeric prefix calculation is not a network configuration recommendation. RFC 5942 explains that an address assignment and an on-link prefix are separate concepts. Routers, prefix information options, allocation policy, provider rules, firewall configuration, and address-management plans determine operational behavior. Check the authoritative network design before applying a calculated range.

No address is transmitted or looked up. The page does not query WHOIS, DNS, BGP, geolocation, abuse feeds, or an interface on the device. This makes it suitable for documentation examples and private planning, including RFC 3849 documentation prefixes, but it cannot confirm ownership or reachability.

For reliable use, paste the address without brackets, a port, or a suffix; enter the prefix separately; calculate; and compare the canonical address with the source. Then review the network and range boundaries. If a production change depends on the result, independently verify it in the network platform’s supported tooling and preserve the current configuration for rollback.

Methodology & sources

Parse RFC 4291 pure IPv6 hexadecimal text into exactly eight 16-bit fields, expand one optional :: run, and combine fields into a 128-bit BigInt. Validate prefix 0–128, clear host bits for the network, set host bits for the numeric upper bound, and compute 2^(128-prefix). Format lowercase RFC 5952 text by suppressing leading zeroes and compressing the first longest zero run of length two or more.

Frequently asked questions

Does IPv6 have a broadcast address?
No. The displayed last address is only the numeric upper bound of the prefix.
Why is a single zero field not replaced by ::?
RFC 5952 recommends compressing only runs of at least two zero fields.
Are zone IDs or IPv4-embedded forms supported?
No. The bounded parser accepts pure IPv6 text without an interface zone or dotted-decimal suffix.
Does the result prove that a prefix is on-link or routable?
No. Numeric containment is separate from router advertisements, policy, assignment, and operational reachability.

Developer Tools guides

View all