Skip to main content
QUIETLYTIC
Networking

IPv6 Calculator

Expand, compress and inspect an IPv6 address or prefix.

Local · nothing leaves this browser Waiting for an address
Esc Clear
Canonical form, range and scope

Enter an address on the left.

How it works

The same IPv6 address can be written many ways, and string comparison does not know they are the same address. That is the whole problem this page exists for: an allowlist entry, a log line and a config file can all name one host and match none of each other.

One canonical form, defined by RFC 5952

Lowercase. Leading zeros dropped from each group. :: applied to the longest run of zero groups, and to the leftmost when two runs tie. A run of exactly one zero group is left alone — :: saves nothing there and would create a second valid spelling, which is the thing the RFC is trying to prevent. 2001:0DB8:0000:0000:0000:0000:0000:0001 has exactly one correct short form: 2001:db8::1.

::ffff:192.0.2.1

An IPv4-mapped address: the last 32 bits are a complete IPv4 address, written dotted by convention. It is how a dual-stack socket reports an IPv4 peer, which is why it appears in logs from software that speaks only v6 internally — and why a naive allowlist check against a v4 string will miss it.

The zone index is not part of the address

%eth0 identifies which local interface a link-local address applies to. It is stripped before parsing. The same fe80:: address can exist on every interface a host has, which is precisely why the zone is needed to use one and why it cannot be part of the address itself.

No broadcast, no reserved ends

IPv6 has no broadcast address — the concept was removed and its work given to multicast. Nor does a prefix reserve its first or last address, so every address in a block is usable. A /64 holds 18,446,744,073,709,551,616 of them, counted exactly here rather than through a float that would already have rounded.

Example

2001:db8::/48 runs from 2001:db8:: to 2001:db8:0:ffff:ffff:ffff:ffff:ffff — 1,208,925,819,614,629,174,706,176 addresses, and it is documentation space under RFC 3849, so nothing there is real.

Frequently asked questions

Why is there only one correct compressed form?

RFC 5952 exists because the same address could otherwise be written several ways, which breaks string comparison in logs, allowlists and configuration files. Canonical form is lowercase, drops leading zeros in each group, and applies :: to the longest run of zero groups — the leftmost when two runs tie. A run of exactly one zero group is left alone, because :: saves nothing there.

What is ::ffff:192.0.2.1?

An IPv4-mapped IPv6 address: the last 32 bits are a whole IPv4 address, written in dotted form by convention. It is how a dual-stack socket reports an IPv4 peer, which is why it turns up in logs from software that only speaks v6 internally.

Does the %eth0 on the end matter?

That is a zone index, and it identifies which local interface a link-local address applies to rather than forming part of the address itself. It is stripped before parsing. The same fe80:: address can exist on every interface a host has, which is exactly why the zone is needed to use one.

Related tools

From the intelligence desk