IPv6 Subnet Calculator

Runs in browser New Internet & Network

Enter a prefix such as 2001:db8:abcd::/48 in any valid spelling and get its first and last address, the expanded form with the network/interface boundary marked, its size, the ip6.arpa reverse zone and the standard assignment sizes it holds (/56 sites, /64 LANs, /127 router links). The split lists subnets of a longer prefix 256 at a time from any subnet number, with the subnet ID in hex, so you can find the 300th /64 of a /48 directly. The 128-bit arithmetic runs exactly in your browser.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How is an IPv6 prefix divided into subnets?

An IPv6 address is 128 bits, and a prefix such as 2001:db8:abcd::/48 fixes the first 48 of them (RFC 4291). The bits between the prefix and /64 are the subnet ID — 16 bits, or 65,536 subnets, in a /48 — and the last 64 bits identify interfaces, which is why every LAN is a /64: SLAAC needs the full 64-bit interface identifier (RFC 7421). End sites should get room for many subnets, never just one /64: RFC 6177 dropped the old default of a /48 for every site and names a /56 for homes, while in provider practice organisations commonly get a /48 and homes a /56 or a /60. Router-to-router links may use a /127 (RFC 6164).

How to use IPv6 Subnet Calculator

  1. Type the prefix in the IPv6 prefix field, for example 2001:db8:abcd::/48 or fd12:3456:789a::/48.
  2. Leave the calculation on Prefix details to see its range, size, boundary and reverse zone.
  3. To plan subnets, choose Split into subnets and set the subnet prefix length, /56 for sites or /64 for LANs.
  4. To jump to a particular subnet, set the first subnet to list (300 or 0x12c), then download the table as CSV if you need it.

IPv6 Subnet Calculator features

  • Reads any valid spelling of an IPv6 prefix (compressed or expanded, upper or lower case, with brackets) and moves an address inside the prefix to its first address
  • First and last address, the fully expanded form with a bar where the network part ends, the prefix length against the interface bits and the exact number of addresses
  • How many /48, /56 and /64 blocks fit inside, and a table of the standard assignment sizes from /29 to /128 with what each is usually given to (RFC 6177, RFC 6164, RIPE NCC policy)
  • The ip6.arpa reverse zone (or the zones a prefix off a hex digit needs), the address type (global unicast, unique local, documentation, link-local…) with a table of the ranges inside a block that holds several types, and the previous and next prefix of the same size
  • Split into subnets of any longer prefix, 256 rows at a time from any subnet number in decimal or hex, each with its subnet ID in hex and its first and last address
  • Plain warnings when a prefix is longer than /64 (SLAAC stops working), not a multiple of 4 bits, a documentation prefix or a unique local prefix

Inputs and outputs

Inputs

  • IPv6 prefix: an IPv6 address with /prefix, 0 to 128; brackets are removed, a zone identifier (%eth0) is refused because it is not part of a prefix.
  • Calculation: Prefix details and assignment sizes, or Split into subnets.
  • Subnet prefix length (/49 to /128, longer than the prefix) and First subnet to list (a subnet number in decimal or 0x hex, 0 by default) for the split.

Outputs

  • At a glance: total addresses and the number of /64, /56 and /48 blocks inside; or the subnet count, prefix, ID bits and size.
  • Result: the prefix, expanded network address, boundary, first and last address, size, mask, address type, reverse zone and neighbouring prefixes; or the split summary.
  • Subnets table (number, ID in hex, subnet, first and last address, up to 256 rows, CSV download), the table of standard sizes that fit inside the prefix, and for a prefix that holds several address types, the table of the ranges inside it.

IPv6 Subnet Calculator example

Splitting a /48 site prefix into /56 blocks

Input:

IPv6 prefix: 2001:db8:abcd::/48 · Calculation: Split into subnets · Subnet prefix length: /56 · First subnet to list: 0

Output:

Subnets 256 · Subnet prefix /56 · Subnet ID bits 8 (2 hex digits) · Addresses per subnet 4.72 × 10^21
#0 · ID 00 · 2001:db8:abcd::/56 · 2001:db8:abcd:: – 2001:db8:abcd:ff:ffff:ffff:ffff:ffff
#1 · ID 01 · 2001:db8:abcd:100::/56 · 2001:db8:abcd:100:: – 2001:db8:abcd:1ff:ffff:ffff:ffff:ffff
… #255 · ID ff · 2001:db8:abcd:ff00::/56

How to read the IPv6 Subnet Calculator results

The number of /64 subnets is how many LANs or VLANs the prefix can number; the /56 and /48 counts are how many sites of those sizes you could delegate from it.

The subnet ID is the part you choose when you number your networks: with a /48 split into /64, it is the fourth group of the address, so subnet 0x0a10 is 2001:db8:abcd:a10::/64.

A bar on its own means the prefix ends on a hex digit and its reverse zone can be delegated as one zone. A bar followed by "+1", "+2" or "+3 bits" means the prefix reaches that far into the next digit: its reverse zone has to be delegated as several zones, and subnets will not line up with the digits you read.

Address type tells you where the prefix belongs: global unicast is routable only when assigned to you, unique local stays inside your networks, and documentation prefixes are for examples only.

When to use IPv6 Subnet Calculator

  • Drawing up an IPv6 addressing plan for a site: which /64 goes to which VLAN, and which /56 to which building.
  • Checking what a provider's prefix delegation gives a home or branch router: a /56 is 256 LANs, a /60 only 16.
  • Finding the exact subnet for a given subnet ID before writing it into a router, a firewall rule or a DHCPv6 configuration.
  • Preparing ip6.arpa reverse zones: seeing the zone name of a prefix and whether it ends on a nibble boundary.

Troubleshooting

  • "Add a prefix length": an IPv6 address alone does not say how large the block is; add /48, /56 or /64.
  • "An IPv6 address may contain "::" only once": "::" stands for a single run of zero groups, so 2001:db8::1::/48 is ambiguous. Write the zeros of one of the runs out.
  • "This looks like an IPv4 address": dotted IPv4 networks belong in the IPv4 Subnet Calculator.
  • The start number is past the last subnet: a /48 split into /56 has subnets 0 to 255 only. Lower the start number or choose a longer subnet prefix.

Frequently asked questions about IPv6 Subnet Calculator

How many /64 subnets are in a /48?

65,536. A /48 leaves 16 bits before the /64 boundary, and 2^16 = 65,536; those 16 bits are exactly the fourth group of the address, so the subnets run from 2001:db8:abcd:0000::/64 to 2001:db8:abcd:ffff::/64. A /56 holds 256 of them and a /60 holds 16.

Why should a LAN always be a /64?

Stateless address autoconfiguration (SLAAC) builds each device's address from a 64-bit interface identifier, so it only works on a /64 (RFC 4291, RFC 7421). A longer prefix on a LAN leaves Android phones and other SLAAC-only devices without an address. The exceptions are /127 for point-to-point links between routers (RFC 6164) and /128 for a single address.

What prefix size should a site or a home get?

RFC 6177 dropped the old rule of a /48 for every site: a home can be given less, such as a /56, but should still get much more than a single /64 so that it can have several LANs. In practice many providers delegate a /48 to businesses and a /56 (256 LANs of /64) to homes, and some give homes a /60 (16 LANs). The table under the result shows how many blocks of each common size your prefix holds.

What changes when the prefix length is not a multiple of 4?

Each hex digit is 4 bits, so a /50 ends two bits into a digit: the subnets do not line up with the digits you read, and the ip6.arpa reverse zone, which has one label per hex digit, cannot be delegated at that boundary. The page marks where the boundary falls and says so; /48, /52, /56, /60 and /64 avoid the problem.

How do I find a particular subnet, such as the 300th /64?

Choose the split, set the subnet prefix to /64 and the first subnet to list to 300 (or 0x12c in hex). The table then starts at that subnet and shows its number, its subnet ID in hex, its prefix and its first and last address. Subnets are numbered from 0.

Why are some counts written as 1.21 × 10^24?

IPv6 sizes are too large to read digit by digit: a /48 holds 2^80 = 1,208,925,819,614,629,174,706,176 addresses. Counts with more than 15 digits are shown in scientific notation rounded to three significant digits, followed by the exact integer; the stat cards show only the short form. The arithmetic itself is exact.

Technical notes

An IPv6 address is 128 bits written as eight 16-bit groups in hex (RFC 4291); the results use the canonical text form of RFC 5952: lower case, leading zeros dropped and the longest run of zero groups replaced by "::". A prefix length p leaves 128 − p interface bits, so the prefix holds 2^(128 − p) addresses; IPv6 has no broadcast address, so the first and last address are simply the ends of the block.

A split into prefix n borrows n − p bits as the subnet ID, giving 2^(n − p) subnets of 2^(128 − n) addresses each. Subnet k starts at the prefix's first address plus k × 2^(128 − n); its ID is k in hex, which is what you read in the address when n − p is a multiple of 4. The reverse zone is one ip6.arpa label per hex digit, in reverse order, which is why it needs a prefix that ends on a digit (a multiple of 4 bits).

All values are BigInt in @engines/ip-calc on top of @engines/ip, which also classifies the special-purpose blocks of the IANA IPv6 registry (RFC 6890): documentation 2001:db8::/32 (RFC 3849) and 3fff::/20, unique local fc00::/7 (RFC 4193), link-local fe80::/10, multicast ff00::/8, 6to4, Teredo, NAT64 and the rest. Counts longer than 15 digits are written in scientific notation followed by the exact integer.

Limitations and methodology

Lists at most 256 subnets per run; the counts always cover the whole prefix, and the start number moves the list.

It calculates addresses only: it cannot tell whether a prefix is assigned to you, routed or announced, or whether your provider will delegate that size.

Ranges that do not form one prefix, overlaps and merges of several blocks are handled by the IP Range Calculator.

Security and privacy

The prefix and the numbers you type are calculated in your browser and are not sent anywhere; nothing is stored.

References