TSE.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Computer Science · Network Engineering · IP Networking

IPv6 Address Calculator

Calculates IPv6 subnet details including network address, prefix length, total addresses, and usable host range from a given IPv6 CIDR notation.

Calculator

Advertisement

Formula

Where N_{addresses} is the total number of IPv6 addresses in the subnet, and p is the prefix length (0–128). The network address is obtained by applying the prefix mask to the given IPv6 address. The first address is the network address and the last address is the subnet broadcast/anycast address. Usable hosts = N_{addresses} - 2 for typical unicast subnets (excluding the first network and last reserved address).

Source: IETF RFC 4291 — IP Version 6 Addressing Architecture; RFC 3513 — IPv6 Addressing Architecture.

How it works

IPv6 uses 128-bit addresses, represented as eight groups of four hexadecimal digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Unlike IPv4's 32-bit address space of roughly 4.3 billion addresses, IPv6 provides 2128 ≈ 3.4 × 1038 unique addresses — enough to assign trillions of addresses to every atom on Earth's surface. This enormous space makes address exhaustion a non-issue for the foreseeable future, but it also requires careful understanding of prefix hierarchies for efficient allocation.

A CIDR (Classless Inter-Domain Routing) prefix like /64 means the first 64 bits identify the network, and the remaining 64 bits are the interface identifier (host portion). The total number of addresses in any subnet is calculated as 2(128 − p), where p is the prefix length. A /64 subnet contains exactly 264 ≈ 18.4 quintillion addresses — a standard size for a single LAN segment per RFC 4291. A /48 prefix, typically assigned to a site or organization, contains 280 addresses and can be subdivided into 65,536 individual /64 subnets. Provider-level allocations often use /32 blocks, allowing for 65,536 customer /48 assignments.

Practical subnetting decisions depend on the deployment context. Home networks typically receive a /56 or /48 from their ISP, providing 256 or 65,536 /64 subnets respectively for internal use. Data centers may use /126 or /127 prefixes for point-to-point links (RFC 6164), conserving address space while maintaining proper routing semantics. Host routes use /128 prefixes — a single address — commonly seen in loopback interfaces, anycast configurations, or mobile IPv6 bindings.

Worked example

Scenario: An enterprise receives a /48 allocation from its ISP and wants to understand how many /64 LAN subnets it can create and how many hosts each supports.

Given: Prefix length p = 48 for the site block; each LAN segment uses a /64.

Step 1 — Total addresses in the /48:
Total = 2(128 − 48) = 2801.208 × 1024 addresses

Step 2 — Number of /64 subnets within the /48:
Subnet bits = 64 − 48 = 16 bits
Number of /64s = 216 = 65,536 subnets

Step 3 — Addresses per /64 subnet:
Host bits = 128 − 64 = 64 bits
Addresses = 264 = 18,446,744,073,709,551,616 addresses per subnet

Step 4 — Usable hosts per /64:
Usable = 264 − 2 = 18,446,744,073,709,551,614 hosts
(Subtracting the network address and the subnet-router anycast address per RFC 4291)

Conclusion: The enterprise can create 65,536 separate /64 LAN segments, each capable of hosting over 18 quintillion devices — more than sufficient for any realistic deployment scenario.

Limitations & notes

This calculator uses JavaScript's floating-point arithmetic (IEEE 754 double precision), which can exactly represent integers only up to 253. For prefix lengths smaller than /75, the total address count exceeds this limit and results are displayed as approximations or capped at 253. For exact large-integer arithmetic at very small prefix values (e.g., /0 through /53), use a dedicated big-integer library or Python's built-in arbitrary-precision integers. Additionally, this tool calculates address counts based on prefix length alone and does not parse or validate full IPv6 address strings — it does not compute the actual network address, broadcast address, or address range from a specific IPv6 address input. Special-use address ranges (loopback ::1/128, link-local fe80::/10, multicast ff00::/8) have different host assignment rules that are not reflected here. RFC 6164 recommends /127 prefixes for point-to-point links rather than /126 to prevent subnet-router anycast issues — consult current RFCs for production deployments.

Frequently asked questions

What is the standard subnet size for a single IPv6 LAN segment?

RFC 4291 recommends a /64 prefix for all standard IPv6 LAN subnets. This provides 2^64 ≈ 18.4 quintillion addresses per segment and is required for Stateless Address Autoconfiguration (SLAAC) to function correctly, as SLAAC uses the lower 64 bits for the interface identifier.

How many IPv6 addresses are there in total?

The IPv6 address space contains 2^128 ≈ 3.4 × 10^38 unique addresses. This is approximately 79 octillion times larger than the entire IPv4 address space of 4.3 billion addresses, and is considered virtually inexhaustible for any foreseeable networking need.

What prefix length should I use for point-to-point links in IPv6?

RFC 6164 recommends using /127 prefixes for point-to-point IPv6 links between routers, providing exactly 2 addresses — one for each endpoint. Using /126 is also common but can trigger subnet-router anycast address conflicts. Avoid /64 for router-to-router links as it wastes a massive address block for just two devices.

What is the difference between a /48, /56, and /64 in IPv6?

A /48 is a site-level prefix typically assigned to organizations, allowing 65,536 individual /64 subnets. A /56 is often given to home users by ISPs, providing 256 /64 subnets. A /64 is the standard individual subnet, assigned to a single LAN segment. These three tiers form the common hierarchical allocation model described in RFC 6177.

Why does IPv6 not use ARP like IPv4?

IPv6 replaces ARP (Address Resolution Protocol) with Neighbor Discovery Protocol (NDP), defined in RFC 4861. NDP uses ICMPv6 messages to perform address resolution, router discovery, and duplicate address detection. It is more efficient, secure (when combined with SEND), and works natively with IPv6's multicast architecture rather than broadcasts.

Last updated: 2025-01-15 · Formula verified against primary sources.