Cadmeo

IPv4 to IPv6 Converter

IPv6 forms
IPv4-mapped: ::ffff:192.0.2.42

The form used when an IPv4 address appears in an IPv6 socket. This is the one you almost always want.

IPv4-compatible: ::c000:22a

Deprecated by RFC 4291. Shown because legacy configuration files still contain it.

6to4 prefix: 2002:c000:22a::

The 2002::/16 tunnelling prefix. The relay infrastructure was deprecated by RFC 7526.

The IPv4 to IPv6 converter shows the three historical ways an IPv4 address has been embedded in IPv6 notation, and marks which are still current. Only one of the three, the IPv4-mapped form, is in general use; the other two are deprecated but still turn up in old configuration files.

How it works

  • IPv4-mapped, ::ffff:192.0.2.42, defined in RFC 4291 and the form you will actually encounter. It represents an IPv4 address inside an IPv6 socket API.
  • IPv4-compatible, ::c000:22a, deprecated by RFC 4291 in 2006. Written with the four octets as two hex groups.
  • A 6to4 prefix, 2002:c000:22a::, from the automatic tunnelling scheme in RFC 3056, whose relay infrastructure was deprecated by RFC 7526 in 2015.

The conversion itself is straightforward: each octet becomes two hex digits, and pairs of octets become one 16-bit group. 192.0.2.42 is c0.00.02.2a in hex, which groups as c000 and 022a.

Examples

A documentation address

IPv4

192.0.2.42

Result

Mapped ::ffff:192.0.2.42 · Compatible ::c000:22a · 6to4 2002:c000:22a::

The mapped form keeps the dotted-quad notation, which is deliberate. It stays readable to anyone who knows the IPv4 address.

An invalid octet

IPv4

192.0.2.300

Result

Flagged: each part must be a whole number from 0 to 255

An octet is eight bits, so 255 is the maximum. 300 is a common typo that some tools accept and silently wrap.

Frequently asked questions

Which IPv6 form should I actually use?

The IPv4-mapped form, ::ffff:a.b.c.d. It is the only one of the three still current, and it is what a dual-stack socket reports when an IPv4 client connects. The other two are shown because they appear in older configuration files and it helps to recognise them.

Does converting an address give me IPv6 connectivity?

No. These notations represent an IPv4 address within IPv6 syntax; they do not create an IPv6 route. Reaching a host over IPv6 requires that host to have a real IPv6 address and a network path to it.

Why is the IPv4-compatible form deprecated?

Because it was designed for an automatic tunnelling model that never worked well, and it created ambiguity with the mapped form. RFC 4291 deprecated it in 2006, and current stacks do not generate it.

What was 6to4 for?

Automatic tunnelling of IPv6 traffic over an IPv4-only network, using the 2002::/16 prefix with your IPv4 address embedded. It depended on public relay routers whose reliability was poor enough that RFC 7526 formally deprecated the scheme in 2015.