IPv6 Subnet Calculator
Understanding IPv6 subnetting before you calculate
This calculator helps you do three jobs that often appear together in IPv6 planning: expand a compressed address into full notation, apply a prefix length, and identify the resulting subnet boundaries. If you have ever looked at an address like 2001:db8::1/64 and wanted to know exactly which part is the network and how large that subnet really is, this page is designed for that question. Enter an IPv6 address in either compressed or fully expanded form, choose a prefix from /0 through /128, and the tool shows the expanded address, network address, first address, last address, and total number of addresses in the range.
Internet Protocol version 6, or IPv6, expands the limited address space of IPv4 to a seemingly boundless field of 2128 unique addresses. Instead of dotted decimal, IPv6 expresses addresses in eight groups of hexadecimal digits separated by colons. Because the addresses can be extremely long, the standard allows compression rules such as omitting leading zeros and collapsing one consecutive string of zero-valued groups into a double colon. The calculator below accepts either abbreviated or fully expanded notation and normalizes the address before performing arithmetic, so you can paste the form you already have and still get a reliable answer.
The central idea in subnetting is that an address is split into two logical sections: a network prefix and a host identifier. Administrators choose a prefix length, written as a slash followed by an integer, to specify how many of the most significant bits belong to the network portion. For example, a /64 prefix reserves the first sixty-four bits for routing while leaving sixty-four bits to number individual interfaces inside the subnet. The number of possible addresses is governed by the remaining bits, and can be expressed with the formula:
Formula: N = 2^128-p
where is the prefix length. For a /64 subnet, the calculation becomes , yielding over eighteen quintillion addresses. That figure is so large that IPv6 address planning is not about squeezing out the last few addresses the way IPv4 often is. Instead, it is about clean structure: choosing prefixes that are easy to delegate, document, summarize, and troubleshoot.
To compute the network address, the calculator converts the input address to a 128-bit integer. It then generates a mask where the first p bits are ones and the remaining bits are zeros. Applying a bitwise AND operation between the address and mask clears the host portion, revealing the network identifier. The process can be summarized by the equation:
Formula: A_net = A & 2^p - 1 << 128 - p
Here represents the numerical address value. Shifting the mask ensures it occupies the most significant bits. The calculator also determines the first usable address, identical to the network address in IPv6 because there is no special broadcast or gateway reservation, and the last address at the opposite end of the range. That last address is derived by setting all host bits to one, which is equivalent to adding the host capacity minus one to the network base.
If you are coming from IPv4, this last point matters. Many people instinctively expect the first address to be the subnet identifier and the last address to be a broadcast address. In IPv6, broadcast does not exist. Multicast replaces that model, so both the lowest and highest addresses in a subnet are usable from a protocol perspective. Real organizations may still reserve certain addresses by policy, but those are local conventions, not protocol rules. This is why the calculator reports the first host address as the same value as the network address and why the last address is also shown as usable.
How to use the calculator effectively
Start by entering the IPv6 address exactly as you know it. The tool accepts compressed values such as 2001:db8::1 and fully expanded values such as 2001:0db8:0000:0000:0000:ff00:0042:8329. Next, enter the prefix length. Common allocations include /48 for larger sites, /56 for homes or smaller organizations, and /64 for ordinary LAN segments. After you click Calculate, the results table expands to show the normalized address and the subnet boundaries derived from your input. If you are documenting a plan, the Copy Result button packages the status line and table values into a single clipboard-ready block.
What should you look for in the result? The expanded address is useful when you need to compare hextets visually or verify that a compressed address was typed correctly. The network address confirms which subnet the host belongs to after all host bits are cleared. The first and last addresses show the edges of the subnet. Finally, the total address count gives you scale. For narrow operational subnets such as /127 point-to-point links, the total is small and easy to grasp. For /64 and shorter prefixes, the numbers quickly become enormous, which is normal in IPv6.
Worked example
Suppose you enter 2001:db8:1234:5678:abcd::42 with a prefix of /64. When the calculator expands the address, it becomes 2001:0db8:1234:5678:abcd:0000:0000:0042. Because a /64 fixes the first four hextets, the network portion is 2001:db8:1234:5678::/64. The first address in that subnet is therefore 2001:db8:1234:5678::, and the last address is 2001:db8:1234:5678:ffff:ffff:ffff:ffff. The host field has sixty-four bits, so the subnet contains 264 possible addresses. In practice, you would never enumerate them one by one, but seeing the exact network start and end values is very helpful when checking router advertisements, static routes, DHCPv6 pools, firewall policies, or inventory records.
Now compare that same address with a /80 prefix. The first five hextets are fixed instead of the first four, so the network becomes 2001:db8:1234:5678:abcd::/80. The last address contracts to 2001:db8:1234:5678:abcd:ffff:ffff:ffff. The subnet is still large in human terms, but it is dramatically smaller than a /64 because only forty-eight host bits remain. This is why prefix length matters so much: every extra network bit halves the remaining address capacity and makes the subnet more specific.
Common prefix sizes and what they imply
The table below highlights how prefix length influences host capacity. It is useful not because you need to memorize every number, but because it builds intuition. A /48 is extremely broad, a /64 is the standard size for most ordinary subnets, and a /96 is already narrow enough that the total count looks manageable compared with typical IPv6 ranges.
| Prefix | Host Bits | Addresses |
|---|---|---|
| /48 | 80 | 1,208,925,819,614,629,174,706,176 |
| /56 | 72 | 4,722,366,482,869,645,213,696 |
| /64 | 64 | 18,446,744,073,709,551,616 |
| /80 | 48 | 281,474,976,710,656 |
| /96 | 32 | 4,294,967,296 |
Although these numbers appear astronomical, they serve practical purposes. A service provider might delegate a /48 to a large organization, allowing that enterprise to create 216 individual /64 subnets for separate campuses, VLANs, labs, or departments. Home networks often receive a /56 or /64 from an Internet service provider, enabling multiple segments for trusted devices, guests, IoT equipment, or lab testing without any pressure to conserve addresses. The abundance of space lets designers prioritize clean hierarchy and route aggregation instead of awkward conservation tricks.
Subnetting also plays an important role in neighbor discovery and stateless address autoconfiguration. Devices combine the network prefix with an interface identifier to create a full IPv6 address. Older designs often discussed EUI-64 derivation from a MAC address, while many modern systems use privacy-oriented temporary interface identifiers. Either way, the subnet boundary still determines which leftmost bits are fixed and which rightmost bits vary. That is the exact boundary this calculator reveals. When you are troubleshooting whether two addresses belong on the same link, checking the network address after masking is much clearer than relying on a quick visual guess.
Internally, the JavaScript implementation handles 128-bit values with BigInt, a native ECMAScript feature that supports integers far beyond ordinary floating-point precision. Parsing involves expanding abbreviated addresses by locating any double colon and inserting the required zero groups. Once normalized to eight groups, each four-hex-digit chunk converts to a 16-bit value that is shifted and combined into a single 128-bit integer. Because the arithmetic happens in the browser, the page can work privately and quickly without sending your address plan to any outside service.
One more practical note: this calculator treats the entire subnet mathematically. It does not try to infer special business rules such as reserving low addresses for routers, assigning certain ranges to servers, or excluding privacy addresses from inventories. Those are real-world conventions, but they vary from one organization to another. The math here stays neutral. It tells you what the subnet is, how large it is, and where its boundaries are so you can apply your own operational policy on top of that result.
For those transitioning from IPv4, it is important to dispel another common misconception. IPv6 does not remove the need for planning; it changes the style of planning. Instead of carving tiny subnets to avoid waste, you usually choose stable prefix boundaries that fit routing design, delegation structure, and future growth. A clean address plan is easier to summarize in routing tables, easier to read in documentation, and easier to secure with policy rules. That is why understanding subnet boundaries is foundational even when the raw address supply is enormous.
The optional game farther down the page reinforces this same idea in a quick, visual way. For fast play it uses common hextet-aligned prefixes such as /32, /48, /64, /80, and /96, because those are easy to compare at a glance. The calculator itself is more general and supports every prefix length from /0 through /128, including unusual boundaries like /63, /73, or /127.
Recording your subnet plan
Once the results table populates, use the copy button to capture the expanded address, network range, and address count. Saving these details in a network journal, IPAM system, configuration repository, or change record helps maintain consistent addressing across deployments and makes audits easier later. IPv6 becomes much more approachable when each subnet is documented with its prefix, purpose, and boundary calculations rather than remembered informally.
| Property | Value |
|---|
Mini-game: Prefix Patrol
Want to build subnet intuition by feel? In this optional mini-game, you are a router operator screening inbound packets. Tap only the packets whose leftmost hextets match the target subnet. The target prefix changes every wave, packet speed climbs over time, and a rare MASK orb slows traffic for a short breather.
How to interpret the output once it appears
The results table is intentionally simple, but each line answers a different operational question. Expanded Address shows the exact eight-hextet form of what you entered. That is especially useful when you are comparing similar-looking addresses or checking whether a compressed :: abbreviation hid more zero groups than you expected. Prefix Entered simply reflects the mask length you asked the calculator to apply, which helps when you are copying results into documentation and want the input context preserved next to the range data.
Network Address is the most important output if your goal is routing or subnet membership. It tells you which subnet the address belongs to after all host bits are zeroed. Two addresses are on the same subnet only if their masked network values are the same for the prefix you are evaluating. First Host Address matches the network address in IPv6 because there is no broadcast reservation. Last Host Address shows the other edge of the same range with all host bits set to one. On a /128, these values all collapse to the same single address because there are no host bits left at all.
The last line, Total Addresses, is often the most surprising. It is easy to read the number as if it were a realistic device count, but that is not usually the right mental model. In IPv6, large subnets are normal. A /64 is not wasteful in the way a huge IPv4 subnet might feel; it is the standard size expected by many parts of the ecosystem, including ordinary stateless autoconfiguration behavior. What matters more is whether the prefix boundary is appropriate for your routing and operational design. A longer prefix means a smaller, more specific subnet. A shorter prefix means a broader aggregate that may be useful for delegation or summarization.
Finally, remember that mathematical validity and operational choice are not identical. The calculator tells you the full legal range for the subnet. Your organization may still choose to reserve address patterns for routers, infrastructure, loopbacks, anycast services, documentation, or naming conventions. Those policies are layered on top of the network math. That is exactly why a tool like this is useful: once the neutral boundary is clear, the local policy decisions become easier to document and enforce consistently.
