An IPv6 address is 128 bits written as eight groups of four hex digits. Its first bits say what kind of address it is. The ranges below were checked with Python's ipaddress module (first and last address of each block); the examples use the documentation prefix 2001:db8::/32. Check an address's syntax with the IPv6 Address Validator.
Writing IPv6 addresses
| Rule | Full form | Short form |
|---|---|---|
| Drop leading zeros in each group | 2001:0db8:0000:0000:0000:ff00:0042:8329 |
2001:db8:0:0:0:ff00:42:8329 |
Replace one run of zero groups with :: |
2001:db8:0:0:0:ff00:42:8329 |
2001:db8::ff00:42:8329 |
:: only once, on the longest run (the leftmost if tied) |
2001:0db8:0000:0000:0001:0000:0000:0001 |
2001:db8::1:0:0:1 |
| Lowercase hex (RFC 5952) | 2001:DB8::A |
2001:db8::a |
| Brackets in URLs, with the port outside | https://[2001:db8::1]:8443/ |
Convert in either direction with the IPv6 Address Compressor and the IPv6 Address Expander.
Special-purpose prefixes
| Prefix | Type | Range (first to last) | Notes |
|---|---|---|---|
::/128 |
Unspecified | :: |
"No address yet", used as a source during setup |
::1/128 |
Loopback | ::1 |
Same role as 127.0.0.1 |
::ffff:0:0/96 |
IPv4-mapped | ::ffff:0.0.0.0 to ::ffff:255.255.255.255 |
An IPv4 address seen by a dual-stack socket: ::ffff:192.0.2.1 |
64:ff9b::/96 |
NAT64 well-known prefix | 64:ff9b:: to 64:ff9b::ffff:ffff |
192.0.2.1 becomes 64:ff9b::c000:201 |
64:ff9b:1::/48 |
Local-use NAT64 | For private NAT64 deployments | |
100::/64 |
Discard-only | Traffic sent here is dropped (blackholing) | |
2000::/3 |
Global unicast | 2000:: to 3fff:ffff:...:ffff |
The public internet |
2001::/32 |
Teredo | IPv6 tunnelled over UDP/IPv4 | |
2001:db8::/32 |
Documentation | 2001:db8:: to 2001:db8:ffff:...:ffff |
For examples only; never routed |
3fff::/20 |
Documentation (RFC 9637, 2024) | 3fff:: to 3fff:fff:ffff:...:ffff |
Larger example space |
2002::/16 |
6to4 | Deprecated tunnelling; embeds an IPv4 address (2002:c000:201::1 carries 192.0.2.1) |
|
fc00::/7 |
Unique local (ULA) | fc00:: to fdff:ffff:...:ffff |
Private addressing; in practice only fd00::/8 is used |
fe80::/10 |
Link-local | fe80:: to febf:ffff:...:ffff |
On every interface; never routed; needs a zone: fe80::1%eth0 |
fec0::/10 |
Site-local | Deprecated since 2004 (RFC 3879) | |
ff00::/8 |
Multicast | ff00:: to ffff:ffff:...:ffff |
One-to-many; IPv6 has no broadcast |
Create a random private prefix with the IPv6 ULA Generator: a ULA is fd followed by 40 random bits, giving a /48.
Multicast scopes and groups
The fourth hex digit of a multicast address is its scope.
| Scope | Prefix | Reach |
|---|---|---|
| 1 | ff01:: |
Interface-local (loopback) |
| 2 | ff02:: |
Link-local: the local network segment |
| 5 | ff05:: |
Site-local |
| 8 | ff08:: |
Organisation-local |
| e | ff0e:: |
Global |
| Group | Members |
|---|---|
ff02::1 |
All nodes on the link |
ff02::2 |
All routers on the link |
ff02::5 / ff02::6 |
OSPFv3 routers / designated routers |
ff02::9 |
RIPng routers |
ff02::fb |
mDNS |
ff02::16 |
MLDv2-capable routers |
ff02::1:2 |
All DHCPv6 servers and relay agents on the link |
ff05::1:3 |
All DHCPv6 servers in the site |
ff02::1:ff00:0/104 |
Solicited-node groups used for neighbour discovery |
Solicited-node address: ff02::1:ff plus the last 24 bits of the unicast address. For 2001:db8::abcd:1234 it is ff02::1:ffcd:1234.
Common prefix lengths
| Prefix | Typical holder | Contains |
|---|---|---|
/32 |
ISP or large organisation | 65,536 /48s |
/48 |
One site | 65,536 /64 subnets |
/56 |
Home connection | 256 /64 subnets |
/64 |
One LAN | 2^64 = 18,446,744,073,709,551,616 addresses |
/127 |
Point-to-point router link | 2 addresses |
/128 |
One host (loopback, a single route) | 1 address |
Keep LANs at /64: SLAAC and many features expect it. Plan subnets with the IPv6 Subnet Calculator.
Interface identifiers (EUI-64)
SLAAC can build the last 64 bits from the MAC address: split it in half, insert ff:fe, and flip the seventh bit of the first byte.
| Step | Value |
|---|---|
| MAC address | 00:1a:2b:3c:4d:5e |
Insert ff:fe in the middle |
00:1a:2b:ff:fe:3c:4d:5e |
Flip bit 7 of the first byte (00 → 02) |
02:1a:2b:ff:fe:3c:4d:5e |
| Link-local address | fe80::21a:2bff:fe3c:4d5e |
Because this exposes the hardware address, modern systems use random or stable-privacy identifiers (RFC 8981, RFC 7217) for global addresses instead.