A prefix length on an IPv6 address is the integer from 0 to 128 written after the slash, such as /64 in 2001:db8:1:2::1/64, and it names how many of the 128 address bits identify the network while the rest enumerate the addresses inside the range. To find an IPv6 prefix length you can read it directly from a configured interface with ipconfig, ip -6 addr, or ifconfig, or you can enter the address in the IPv6 Subnet Calculator to confirm the network, the canonical input, the numeric first and last addresses, the number of host bits, and the exact address count. The remaining bits are called host bits, and the size of the range is exactly two to the power of that host count, so a /64 contains 2⁶⁴ numeric values, a /128 contains one address, and a /0 covers the full 128-bit space. Local browser BigInt arithmetic keeps every result exact even for very large ranges, which is why a calculator is the safest way to verify a length without rounding, abbreviation, or interface context. The task the reader is completing is not just naming the number: it is mapping the prefix length onto a usable network boundary for documentation or configuration, with the boundary confirmed against the same integer the operating system or router is advertising.

how to find ipv6 prefix length
How to Find an IPv6 Prefix Length and Range Size

What an IPv6 prefix length actually represents

The IPv6 addressing architecture defined in RFC 4291 treats every address as a 128-bit integer. The prefix length is an integer between 0 and 128 that names how many of the most significant bits form the network identifier; the remaining 128 minus that number of bits are called host bits and define the size of the address range. When the host bits are zero, the value is the network address. When every host bit is one, the value is the numeric upper bound of the range. The address count is two raised to the power of (128 minus the prefix length), expressed exactly using browser BigInt so /0 produces the full 2¹²⁸ address space without floating-point loss and /128 produces a single address.

RFC 5952 governs how the textual representation should look on the wire and in documents: hexadecimal letters are lowercase, leading zeroes are removed inside each of the eight 16-bit fields, and the longest run of two or more all-zero fields is collapsed into a double colon, with the first run winning in a tie. A single zero field stays as 0 because the rule requires a run of at least two. Reading and writing prefix lengths then becomes a textual consistency problem as much as a numeric one, which is why a calculator that emits RFC 5952 canonical output is useful whenever you paste a value into a config file, RFC example, or monitoring script and want the same form back.

Reading the prefix length on a host or router

The fastest way to find the prefix length in real life is to ask the operating system or the router what it just assigned. On Windows, ipconfig /all lists each IPv6 address with a suffix such as /64 next to it, and the same suffix appears next to link-local addresses that begin fe80::. On Linux, ip -6 addr or ip -6 address show prints every address with its prefix length, and the same column appears in ip -6 route for the default and on-link routes. On macOS, the ifconfig output and netstat -rn both display the prefix length column. Router admin panels for most consumer models show the delegated prefix in WAN status and the per-LAN interface prefix in LAN settings, typically written in CIDR form.

When no interface is yet configured, the prefix length is whatever the provider, allocation policy, or documentation hands you. Documentation prefixes such as 2001:db8::/32 always appear with their assigned length, and a /64 is the standard length used for SLAAC on a single LAN segment. If you only have the address text and not the slash, the prefix length is unknown: an address alone does not tell you what range it sits in. That is the moment to reach for a numeric calculator. For the closely related task of extracting the network portion once you already have the slash, the step-by-step guide to finding the IPv6 prefix of an address walks through that side of the calculation in long form.

Prefix lengthTypical deploymentHost bits
/128Single address, loopback, host route0
/64Standard LAN segment for SLAAC and most end sites64
/60Residential delegation granularity68
/56Common home router prefix size72
/48Single-site enterprise or customer allocation80
/32ISP-level block or large organisation allocation96
/0Default static route covering the entire address space128

The exact address count for any row above is two raised to the host-bits column and should be confirmed in the calculator; the table only names the typical deployment roles described in common allocation guidance.

Find the prefix length and compute its range

Once you have an address and a candidate prefix length in front of you, you can run both through the IPv6 Subnet Calculator to see the exact network, the canonical input form, and the numeric range locally.

  1. Open the IPv6 Subnet Calculator and paste a pure IPv6 address. Use either the fully expanded form with eight hexadecimal fields or the RFC 5952 compressed form that contains at most one double colon. Strip any brackets, ports, or suffix characters; the page rejects zone identifiers and dotted-decimal mixed forms.
  2. Type the integer prefix length from 0 through 128 into the prefix field. Do not include the slash; the calculator expects a plain number, and a value outside 0 to 128 will be rejected.
  3. Select Calculate subnet. The page parses the text into a 128-bit BigInt, applies the prefix mask in browser memory, and renders the result without sending the address to any external service.
  4. Review the canonical form of the input, the network prefix with its own /length, the numeric first address, the numeric last address, the host-bit count, and the exact address count. If the canonical form differs from what you pasted, decide whether the original was misquoted before reusing the result.
  5. For production changes, independently verify the calculated range inside the platform's supported tooling and keep the prior configuration available for rollback, since the calculator does not consult router tables, BGP, DNS, WHOIS, or any interface state.

Interpreting the canonical range output

The numeric fields returned by the calculator describe one prefix and its address set. The canonical input is the address you typed rewritten in lowercase RFC 5952 form. The network prefix is the same integer with all host bits cleared, with the /length appended. The numeric first address equals the network prefix itself, because the network value already has every host bit cleared. The numeric last address is the network prefix with every host bit set to one. The host-bits field is 128 minus the chosen prefix length, and the address-count field is two raised to that host-bit count, written as an exact integer string.

Several details matter when you copy those numbers back into a document. A /128 range contains exactly one address, the same address you typed, so the first and last fields print identically and the host-bit count is zero. A /64 prints 2⁶⁴ as the exact count; this is a 20-digit decimal that no spreadsheet will display without scientific notation, which is another reason to keep the value inside the calculator or copy the number verbatim from its string output. The last address is only a numeric upper bound; IPv6 does not define a broadcast address, so the field is never labelled broadcast. Output also normalises the hex letters to lowercase and collapses only runs of two or more zero fields, exactly as RFC 5952 requires.

What the calculator does not decide for you

The numeric answer a subnet calculator returns is the boundary of a 128-bit range, nothing more. Per RFC 5942, an address assignment and an on-link prefix are separate concepts, and the calculator does not query routers, BGP, WHOIS, DNS, or any geolocation feed. It will not tell you whether the prefix is routable, globally assigned, reserved for documentation, multicast, anycast, or appropriate for SLAAC, and it will not decide whether SLAAC makes sense on the link.

Zone identifiers such as %eth0 and IPv4-embedded dotted-decimal forms are explicitly rejected with a clear error, because the parser handles only pure IPv6 text. Reachability, ownership, interface context, and configuration policy remain network-engineering questions answered by routers, allocation policy, and the organisation's address plan. Use the calculated boundary as a numeric check; use the network design as the source of truth for any production change.

Worked example for a /60 documentation prefix

Take the documentation address 2001:0DB8:0:CD30:123:4567:89AB:CDEF with prefix length 60, drawn from the RFC 4291 examples. The host-bit count is 128 - 60 = 68, so the address count is 2⁶⁸. The network address is the input value with every host bit cleared: fields 0 and 1 stay 2001:0DB8, field 2 stays 0000, field 3 stays CD30, and fields 4 through 7 collapse to zero, which gives the canonical network 2001:db8:0:cd30::/60. The numeric upper bound sets every one of the 68 host bits to one, which raises the low four bits of field 3 from 0000 to 1111 (turning CD30 into CD3F) and fills fields 4 through 7 with all ones, yielding 2001:db8:0:cd3f:ffff:ffff:ffff:ffff as the last address. Running the same pair through the calculator returns the same network string, the same last address, and an exact 2⁶⁸ address count, which is the pattern to expect any time you paste a known prefix length next to a known address and read the canonical output back.