An IPv6 subnet mask is normally written as a prefix length from /0 to /128; the number after the slash states how many leading bits of the 128-bit address belong to the network.
Unlike the familiar dotted-decimal masks used with IPv4, an IPv6 mask is normally identified with CIDR notation, such as a /64. The address itself does not contain that prefix length. If you have only an unprefixed IPv6 address, you need to obtain the length from an interface configuration, network design, router information, or another authoritative source before calculating the subnet.
This guide shows how to locate an existing prefix, verify it with a local calculation, interpret the resulting range, and distinguish numerical subnetting from operational network validation.

What the IPv6 subnet mask represents
The RFC 4291 IPv6 addressing architecture defines an IPv6 address as eight 16-bit hexadecimal fields, for a total of 128 bits. A prefix length divides those bits into a network portion and a host portion.
For a prefix length P, the first P bits identify the network, and the remaining 128 − P bits are called host bits by the calculator. Conceptually, the mask contains P one-bits followed by 128 − P zero-bits. The number of numeric addresses covered by that prefix is:
Address count = 2^(128 − P)
| Prefix length | Network bits | Host bits | Numeric address count |
|---|---|---|---|
| /128 | 128 | 0 | 1 |
| /64 | 64 | 64 | 2^64 |
| /0 | 0 | 128 | 2^128 |
These are numerical address-space counts, not recommendations for how many devices can be assigned. IPv6 assignment policy, routing, router advertisements, and other operational rules determine how a prefix may actually be used.
Find the prefix already attached to the address
Begin by checking whether the source already pairs the address with a slash prefix. When an IPv6 address appears in CIDR notation, the integer after the slash is the subnet mask in prefix form. Command-line output may show this directly; for example, Linux ip -6 addr output commonly pairs an IPv6 address with a slash-prefix length. Other consoles and configuration files use labels such as prefix length, prefixlen, or plen.
| What you have | What it establishes | What to do next |
|---|---|---|
| An address followed by /P | The slash integer is the prefix length | Use that integer in the calculator’s separate prefix field |
| A configuration field labeled as a prefix length | The stated integer describes the mask | Confirm that it belongs to the same address and interface |
| Only a plain IPv6 address | No prefix length is encoded in the address | Find the authoritative prefix in the network configuration or design |
| An IPv4-style dotted-decimal mask | It describes a 32-bit IPv4 boundary | Do not reuse it as an IPv6 prefix |
If a system displays several IPv6 addresses, keep each address paired with its own prefix. Do not assume that addresses on the same interface, link, or host necessarily use the same prefix length.
Calculate and verify the subnet mask
Once you have located the address and its authoritative prefix length, use the following workflow to produce an auditable result.
- Enter the pure IPv6 address. Open the IPv6 Subnet Calculator and paste the address portion of the CIDR pair. The accepted syntax is fully expanded IPv6 text or text using one :: to compress consecutive zero fields. Enter the prefix separately rather than leaving a slash prefix attached to the address.
- Enter the prefix length. Supply an integer from 0 through 128. Use the value established by the interface configuration or authoritative network design; do not select a familiar prefix merely because it is common elsewhere.
- Select Calculate subnet. The calculator expands the address into eight fields, converts it to a 128-bit integer, and applies the selected prefix. This calculation uses browser BigInt arithmetic, and the address is neither transmitted nor looked up.
- Review every returned field. Check the canonical input, network prefix, first and last numeric addresses, host-bit count, and exact address count. The first value is the lower numerical bound, while the last is the upper numerical bound for the selected prefix.
- Compare the canonical address with the source. Canonical formatting can remove leading zeroes, use lowercase hexadecimal letters, or compress a run of zero fields. These are representation changes, not changes to the address’s numerical value. A mismatch can reveal a transcription error.
- Record the result in its proper context. For documentation, record the canonical input, network prefix, host bits, range boundaries, and exact count. Before using the result in a production configuration, verify it independently with the network platform’s supported tooling.
Interpret host bits and numeric boundaries
The calculator’s host-bit result follows directly from the prefix. If the prefix is /P, the host-bit count is H = 128 − P, and the exact numerical size of the range is 2^H. The network address is produced by clearing the H lowest bits of the input address.
The first numeric address equals that network value. The last numeric address is found by setting every host bit to one. This is a containment calculation: it tells you which numerical values fall inside the selected prefix, not which addresses are currently assigned or reachable.
Browser BigInt arithmetic keeps even the full /0 range exact without floating-point loss. An IPv6 prefix does not have an IPv4-style broadcast address, however, so the tool’s final value must be described only as the last or numerically upper address.
One complete /60 prefix calculation
The RFC example address 2001:0DB8:0:CD30:123:4567:89AB:CDEF with prefix /60 demonstrates the complete sequence:
- Find the host bits: 128 − 60 = 68.
- Calculate the exact numerical count: 2^68 addresses.
- Clear the 68 host bits: the network prefix becomes 2001:db8:0:cd30::/60.
- Set all 68 host bits: the last numeric address becomes 2001:db8:0:cd3f:ffff:ffff:ffff:ffff.
The canonical input is 2001:db8:0:cd30:123:4567:89ab:cdef, and the first numeric address is the network address shown above. Notice that the final address is a numerical boundary, not a broadcast address.
Canonical text and supported syntax
IPv6 text can be written in expanded or compressed form. The calculator accepts conventional pure-IPv6 representations, expands one optional :: run, and applies the prefix. Its displayed address follows RFC 5952 formatting rules:
- Hexadecimal letters are lowercase, and leading zeroes inside a field are removed.
- The longest run of two or more zero fields is compressed.
- The first run wins when multiple runs have equal length.
- A single zero field is not replaced with ::.
The parser deliberately rejects zone identifiers such as an address ending in %eth0 and IPv4-embedded dotted-decimal forms such as ::ffff:192.0.2.1. Those forms require interface or mixed-address context, so they are rejected with a clear error rather than partially interpreted. Paste the address without brackets, a port, or a suffix.
Check operational meaning before using the result
A numerical prefix calculation does not establish whether a prefix is on-link, routable, globally assigned, reserved, multicast, anycast, or suitable for SLAAC. RFC 5942 explains that address assignment and an on-link prefix are separate concepts, so the address and prefix you calculate with must still be checked against the network’s authoritative design.
The calculator does not query WHOIS, DNS, BGP, geolocation, abuse feeds, or a device interface. It cannot confirm ownership, assignment status, or reachability. Routers, prefix information options, allocation policy, provider rules, firewalls, and address-management plans determine operational behavior.
The result is appropriate for documentation examples and private numerical planning. For a production change, independently verify the address, prefix, and boundaries in the network platform’s supported tools, confirm that the calculated range matches the intended design, and preserve the current configuration so it can be rolled back if necessary.