Computer & IT

IPv6 Address Expander, Compressor & Prefix Tool

Validate, expand and compress IPv6 addresses, identify the type, and find a prefix’s range.

Inputs

Full or shortened form, e.g. 2001:db8::ff00:42:8329. You may add a prefix length, e.g. 2001:db8:abcd:12::1/64.

Optional. Common values: /64 for a LAN, /48 or /56 for a site.

Result

Compressed (RFC 5952 standard form)
2001:db8::ff00:42:8329/64
Fully expanded form
2001:0db8:0000:0000:0000:ff00:0042:8329
Address type
Documentation / example address (RFC 3849)
Network prefix
2001:db8::/64
First address in the prefix
2001:db8::
Last address in the prefix
2001:db8::ffff:ffff:ffff:ffff
Addresses in the prefix
2^64 = 18,446,744,073,709,551,616

Standard form: 2001:db8::ff00:42:8329/64 — Documentation / example address (RFC 3849). It belongs to the prefix 2001:db8::/64.

Educational estimate — check the assumptions below.

About this calculator

An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits separated by colons. To make them shorter, leading zeros in a group may be dropped and one run of all-zero groups may be replaced by “::”. Because there are several ways to shorten the same address, RFC 5952 defines one recommended form. This tool checks an address, writes it in both full and standard short form, says what kind of address it is, and — if you give a prefix length such as /64 — shows the network prefix and its address range.

It is a calculator only and does not contact any network.

Formula

Prefix (network) = address AND mask    Last address = prefix OR (NOT mask)

Addresses in a /n = 2(128 − n)

RFC 5952 short form: lower-case letters; no leading zeros in a group; the longest run of two or more zero groups becomes “::” (the first one if two runs are equally long); a single zero group is written “0”. Calculations use exact 128-bit integer arithmetic.

Worked example

  • 2001:0db8:0000:0000:0000:ff00:0042:8329 → 2001:db8::ff00:42:8329 (documentation range, RFC 3849).
  • With /64: prefix 2001:db8::/64, range 2001:db8:: to 2001:db8::ffff:ffff:ffff:ffff — 2⁶⁴ = 18 446 744 073 709 551 616 addresses.
  • fe80::1 expands to fe80:0000:0000:0000:0000:0000:0000:0001 — a link-local address.
  • 2001:db8:0:0:1:0:0:1 → 2001:db8::1:0:0:1 (the first of two equal zero runs is compressed).

Assumptions and limitations

  • Zone indexes (such as %eth0) are not accepted. An IPv4 dotted part is accepted only at the end (e.g. ::ffff:192.0.2.1).
  • Address types follow the IANA registries and RFCs named; they describe the address range, not how a particular network is configured.
  • In IPv6 there is no broadcast address and all addresses in a prefix are in principle usable; the subnet-router anycast address is the first address of the prefix (RFC 4291).

References

  • IETF RFC 4291 (IPv6 Addressing Architecture), RFC 5952 (Recommendation for IPv6 Address Text Representation), RFC 4193 (unique local addresses), RFC 3849 (documentation prefix).