Skip to content

IPv6 Expander & Compressor

Any IPv6 address in its full and short forms, and what kind of address it is.

Your IPv4: Not detected

Your IPv6: Not detected

Expand or Compress IPv6

Enter any IPv6 address to see its full expanded form, compressed shorthand, type classification, and more.

IP risk check

Is an IP address safe?

Any IP checked against VPN, proxy, Tor and datacenter ranges and public blocklists: a 0–100 risk score with every reason shown. Free, no signup.

Check an IP

IPv6 compression shortens an address by dropping leading zeros and replacing the longest run of zero groups with ::. Paste an IPv6 address above and the tool shows it compressed (the RFC 5952 short form, such as 2001:db8::1) and expanded (all eight groups of four hex digits, 39 characters).

The tool also names the address type (global, link-local, unique local, multicast, documentation and others) and gives the decimal, binary and reverse-DNS forms. The conversion runs in your browser.

How to compress an IPv6 address, step by step

An IPv6 address is 128 bits written as eight 16-bit groups in hexadecimal (RFC 4291, section 2.2). Compression follows three steps, and RFC 5952 fixes the details so that systems which follow it write the same address the same way:

  1. Drop leading zeros in each group. 0db8 becomes db8, 0042 becomes 42, and 0000 becomes 0. Never drop trailing zeros: ff00 stays ff00.
  2. Replace the longest run of all-zero groups with ::. The run must be at least two groups long; a single 0 group stays as 0. If two runs are the same length, shorten the first one.
  3. Use :: only once, and write the hex letters in lower case.

Three worked examples:

Full addressAfter step 1Compressed
2001:0db8:0000:0000:0000:ff00:0042:83292001:db8:0:0:0:ff00:42:83292001:db8::ff00:42:8329
fe80:0000:0000:0000:0202:b3ff:fe1e:8329fe80:0:0:0:202:b3ff:fe1e:8329fe80::202:b3ff:fe1e:8329
2001:0db8:0000:0001:0000:0000:0000:00012001:db8:0:1:0:0:0:12001:db8:0:1::1

The third example shows the “longest run” rule: there is a single zero group after db8 and a run of three before the last group, so :: replaces the three and the single 0 stays. When runs tie, as in 2001:db8:0:0:1:0:0:1, the first run is shortened: 2001:db8::1:0:0:1.

How to expand an IPv6 address

Expansion runs the steps backwards:

  1. Count the groups you can see. 2001:db8::ff00:42:8329 has five.
  2. Replace :: with as many 0000 groups as it takes to reach eight: here, three.
  3. Pad every group to four digits with leading zeros: 2001:0db8:0000:0000:0000:ff00:0042:8329.

The loopback address ::1 shows the method at its extreme: one visible group, so :: stands for seven, giving 0000:0000:0000:0000:0000:0000:0000:0001.

When you need the expanded form

  • Comparing addresses as text. 2001:db8::1, 2001:DB8:0:0::1 and the full form are the same address, but a plain string comparison or a grep treats them as different. Normalise both sides first, to either form.
  • Reverse DNS. PTR names under ip6.arpa are built from all 32 nibbles of the expanded address, written backwards (RFC 3596). The tool prints that name for you; use the reverse DNS lookup to see what it resolves to.
  • Fixed-width storage and sorting. Databases and spreadsheets sort the expanded form correctly; the compressed form can sort out of order (2001:db8::10 sorts before 2001:db8::2 as text).

For everything a person reads or types, such as configs, documentation and tickets, use the compressed RFC 5952 form.

IPv6 address format and types

The first groups tell you what kind of address you have. The tool’s “Address Type” row uses these prefixes (it checks the more specific ones, such as 2001:db8, before the general 2 or 3):

Starts withTypeExample
2 or 3Global unicast (public)2606:4700:4700::1111
fe80Link-local (same network segment only)fe80::1
fd (and fc)Unique local (private, like 10.0.0.0/8; addresses in use start with fd)fd12:3456:789a::1
ffMulticastff02::1
2001:db8Documentation only2001:db8::1
2001:0Teredo tunnel2001:0:4136:e378::1
20026to4 tunnel2002:c000:204::1
::ffff:IPv4-mapped::ffff:192.168.1.1 (the tool shows ::ffff:c0a8:101)
::1 / ::Loopback / unspecified::1

To see where a public IPv6 address is and who runs it, use the IP lookup. To write an IPv4 address as IPv6, or an address as a single number, use the IP address converter. IPv6 use keeps growing: Google tracks the share of its users who reach it over IPv6 on its IPv6 statistics page.

Frequently Asked Questions

Can :: be used twice in an IPv6 address?

No. A double colon may appear only once. With two, there is no way to know how many zero groups each one stands for: 2001::1::1 could mean several different addresses, so it is invalid.

How do you expand ::1?

::1 has one visible group, so the double colon stands for seven zero groups: 0000:0000:0000:0000:0000:0000:0000:0001. It is the IPv6 loopback address, the equivalent of 127.0.0.1. Paste ::1 into the tool to see the full form and the type row read “Loopback (::1)”.

Are leading zeros required in IPv6?

No. Leading zeros in a group are optional, and RFC 5952 says to leave them out: write db8, not 0db8. Trailing zeros are part of the value and must stay: 0db8 can become db8, but db80 cannot become db8, because that is a different number.

What is the shortest form of an IPv6 address?

The RFC 5952 form: leading zeros removed, the longest run of two or more zero groups replaced by :: (the first one if two runs tie), and lower-case letters. The “Compressed Form” row in the tool follows these rules. The tool takes hex groups only, so an IPv4-mapped address written with a dotted tail, such as ::ffff:192.168.1.1, has to be entered in hex (::ffff:c0a8:101).

Should IPv6 addresses be upper or lower case?

Either is valid when reading, since hex is case-insensitive, but RFC 5952 says to write lower case. 2001:DB8::A and 2001:db8::a are the same address; the second is the standard spelling. Lower case also makes logs and text searches match, since grep and many tools compare text case-sensitively.

Can a single zero group be replaced with ::?

Not in the standard form. RFC 5952 reserves :: for runs of two or more zero groups, so 2001:db8:0:1:1:1:1:1 stays as written. Most systems will still read 2001:db8::1:1:1:1:1, but they will not write it.

How long is an IPv6 address?

128 bits. Written in full it is 32 hex digits in eight groups, 39 characters with the colons. Compressed, it can be as short as two characters (::). An IPv4 address, by comparison, is 32 bits; the IP address converter shows one in IPv4-mapped IPv6 form.

How do I find my own IPv6 address?

If your browser reached this site over IPv6, the address is shown at the top of this tool next to “Your IPv6:”. If it says “Not detected”, your connection used IPv4 for this visit. The IP lookup shows its location and network.