Skip to content
ToolBoxGeniehome

IPv6 Address Converter

Developer Tools · Added

The same IPv6 address can be written a dozen ways, and only one of them is canonical. Paste any spelling to get the fully expanded form, the correctly compressed form, the integer behind it, and what the address block is actually for.

Either form works, with or without a /prefix. A URL's square brackets and a %zone suffix are both handled.

Try:

How to use the ipv6 address converter

  1. 1Paste an IPv6 address in any form — compressed, expanded, upper or lower case.
  2. 2Add a prefix length such as /64 if you want the network and last address worked out.
  3. 3Read the expanded and canonical compressed spellings side by side.
  4. 4Check the scope note before assuming an address is routable.

Examples

Compressing a documentation address

Input
2001:0db8:0000:0000:0000:ff00:0042:8329
Result
Compressed to 2001:db8::ff00:42:8329, decimal 42540766411282592856904265327123268393, scope Documentation — with a warning that 2001:db8::/32 never routes on the real internet.

A link-local address

Input
fe80::1
Result
Expands to fe80:0000:0000:0000:0000:0000:0000:0001, scope Link-local, noting that it usually needs a zone index such as fe80::1%eth0 to be meaningful.

About the ipv6 address converter

Why the canonical form exists

IPv6's shorthand rules were written for people typing addresses, and they left room for choice: which run of zeros to collapse, whether to pad groups, which case to use for hex digits. That flexibility is harmless until software starts comparing addresses as strings, at which point two spellings of one address stop matching.

RFC 5952 removed the choice for anything that generates addresses for people to read. It is not a new format, only a rule for picking among forms that were already legal — which is why an address written some other way is still correct, and still worth normalising before you put it in a log line, a config file or a database key.

Reading an address block

The leading bits of an IPv6 address say more about it than an IPv4 first octet ever did. 2000::/3 is the global unicast space actually routed on the internet; fe80::/10 is link-local and valid only on one segment; fc00::/7 is unique local, the rough equivalent of RFC 1918 private space; ff00::/8 is multicast; and 2001:db8::/32 is set aside for documentation and examples.

That last one accounts for a recurring confusion. Addresses in 2001:db8:: appear throughout tutorials and vendor documentation precisely because they can never route anywhere, so copying one into a live configuration produces a link that comes up cleanly and carries no traffic.

Frequently asked questions

Why does my address compress differently elsewhere?
Because more than one shortening is valid and only one is canonical. RFC 5952 settles it: leading zeros in each group always go, the :: replaces the longest run of zero groups, ties are broken by taking the leftmost run, and :: is never used for a single zero group. Devices that predate the rule often emit a legal but non-canonical form, which is why two systems can disagree about the same address.
Can this handle an embedded IPv4 address?
Yes. The IPv4-mapped form ::ffff:192.0.2.128 is parsed and shown back with its dotted tail intact, because rewriting it as pure hex loses the fact that it refers to an IPv4 endpoint. The last 32 bits are read as four decimal octets, and each still has to fall between 0 and 255.
What is the decimal number for?
An IPv6 address is a 128-bit integer, and seeing it as one is occasionally what you need — storing addresses in a database column, sorting them into order, or working out how far apart two of them sit. The value is computed with arbitrary-precision integers, since 128 bits is far past what a JavaScript number can hold exactly.
Why does a /64 not report a usable host count?
Because the IPv4 habit of subtracting a network and a broadcast address does not carry over. IPv6 has no broadcast address, the all-zeros host identifier is reserved as the subnet-router anycast address rather than being unusable, and a /64 holds 18.4 quintillion addresses in any case. The total is reported; a 'usable' figure would be importing a convention that no longer applies.