🌐 IPv6 Prefix Calculator – CIDR Subnetting for IPv6 Networks
The IPv6 Prefix Calculator is a network engineering tool that decomposes any IPv6 CIDR prefix into its full set of properties: network address, first and last usable host, total address count, address type classification, and boundary alignment status. Whether you are planning an ISP allocation, segmenting a datacenter, or studying IPv6 fundamentals, this calculator handles the full 128-bit address space with precise BigInt arithmetic.
What Is an IPv6 Prefix?
An IPv6 prefix is a block of consecutive IP addresses defined by a network address and a CIDR prefix length (written as /N where N is 0–128). The prefix length specifies how many of the leftmost bits are the "network" portion; the remaining bits identify individual hosts within the block.
For example, 2001:db8:abcd::/48 means the first 48 bits (2001:0db8:abcd) identify the network, while the remaining 80 bits can be assigned to hosts — giving 280 ≈ 1.2 × 1024 total addresses.
Standard IPv6 Prefix Sizes
| Prefix | Typical Use | Addresses |
|---|---|---|
/32 | ISP allocation from RIR | 2⁹⁶ ≈ 7.9×10²⁸ |
/48 | Enterprise / large site | 2⁸⁰ ≈ 1.2×10²⁴ |
/56 | Home ISP allocation | 2⁷² ≈ 4.7×10²¹ |
/64 | Single LAN subnet | 2⁶⁴ ≈ 1.8×10¹⁹ |
/128 | Single host / loopback | 1 |
How the Calculator Computes Results
IPv6's 128-bit address space vastly exceeds JavaScript's 53-bit safe integer limit, so this tool uses native BigInt arithmetic throughout:
- Network address:
networkAddr = ipInt & (ALL_ONES << (128 − prefixLen))— all host bits are zeroed. - Last address:
lastAddr = networkAddr | ~mask & ALL_ONES— all host bits set to 1. - Total addresses:
2n ** BigInt(128 − prefixLen) - Sub-prefix step:
step = 2n ** BigInt(128 − newPrefixLen)for splitting.
The calculator also converts addresses between expanded (all 32 hex digits) and compressed RFC 5952 notation (longest run of zeros collapsed to ::).
IPv6 Address Type Classification
IPv6 reserves different prefixes for different purposes. The calculator automatically identifies the address type, scope, and global routability:
- Global Unicast (GUA) —
2000::/3. The most common type; publicly routable on the internet. - Link-Local Unicast (LLA) —
fe80::/10. Used for communication within a single network segment only; never routed globally. - Unique Local (ULA) —
fc00::/7. The IPv6 equivalent of RFC 1918 private ranges; routable within an organization but not on the public internet. - Multicast —
ff00::/8. Used for one-to-many delivery; individual host addresses are not assigned. - Loopback —
::1/128. The host's own address, equivalent to IPv4's 127.0.0.1. - Teredo (2001::/32) and 6to4 (2002::/16) — legacy transition mechanisms embedding IPv4 addresses in IPv6 prefixes.
Prefix Boundary Alignment
A prefix is aligned when all bits beyond the prefix length are zero. If you enter 2001:db8::1/48, the ::1 sets host bits that should be zero — the calculator warns you and shows the correct aligned network address (2001:db8::/48). Misaligned prefixes are technically valid IP addresses, but they are not network addresses; routers expect aligned prefixes in routing tables.
Prefix Splitting
The prefix splitting feature divides a given IPv6 block into a power-of-2 number of equal sub-prefixes. Splitting a /48 into 4 yields four /50 blocks; splitting into 256 yields 256 /56 blocks. Each sub-prefix is displayed with its CIDR notation, first host, and last host. The full list can be exported as a CSV for use in IP address management (IPAM) systems.
Binary Bit-Field Visualization
The binary view renders all 128 bits of the input address as a color-coded strip: blue bits represent the network portion (determined by the prefix length), and orange bits represent the host portion. This visualization makes it immediately clear how much of the address space is dedicated to the network versus individual hosts.
Practical Use Cases
- ISP / RIR allocation planning — verify that customer allocations are correctly aligned and non-overlapping before provisioning.
- Datacenter segmentation — divide a /48 into per-rack or per-zone /56 blocks and confirm total host capacity.
- Firewall and ACL rule authoring — confirm the exact range covered by a CIDR rule before writing it into a policy.
- Education — understand the relationship between prefix length, host count, and address type through live examples.
- Debugging — identify whether a misconfigured device is using a link-local, ULA, or documentation address instead of a publicly routable GUA.
Accuracy and Limitations
All calculations use exact BigInt arithmetic — there is no floating-point rounding error, even for the largest possible block (::/0 with 2128 ≈ 3.4 × 1038 addresses). The tool validates both the IPv6 address format and the prefix length before computing results. Note that IPv6 does not have a "broadcast" address — the last address in a block is simply the highest host address, and it can be assigned to a host (unlike IPv4 broadcast).