Skip to main content
Utility · fully client-side

IPv4 to IPv6 converter

Convert any IPv4 address into IPv4-mapped IPv6, hex-group form, and the 6to4 transition prefix. Paste an IPv6 instead and we'll pull the embedded IPv4 back out. Nothing leaves your browser.

IPv4-mapped (canonical)

::ffff:192.0.2.1

IPv4-mapped (hex groups)

::ffff:c000:201

6to4 prefix (RFC 3056)

2002:c000:201::/48

What IPv4-to-IPv6 conversion actually means

IPv4 addresses live in a 32-bit space (about 4.3 billion possible values). IPv6 addresses live in a 128-bit space (about 3.4 × 10³⁸ possible values). They are not the same space — an IPv4 address cannot be sent on an IPv6-only network, and vice versa. But IPv6 was designed to coexist with IPv4 during the long transition, and part of that design is a set of textual representations that embed IPv4 addresses inside the IPv6 space.

This tool produces three such representations from any IPv4 address you give it:

1. IPv4-mapped IPv6 — ::ffff:1.2.3.4

This is the canonical form defined in RFC 4291 §2.5.5.2. The 128-bit address consists of 80 zero bits, then 16 one bits (0xffff), then the original 32-bit IPv4 address. The familiar dotted-quad sits at the end, which is what makes this form readable.

Where you actually see it: dual-stack socket APIs. A program that opens an AF_INET6 socket can receive both IPv6 and IPv4 connections; the kernel hands IPv4 source addresses to the application as the mapped form so the program doesn't need two separate code paths. If you log peer.addressfrom a Node.js HTTP server, you frequently see ::ffff: prefixes for connections coming over IPv4.

2. Hex-group form — ::ffff:c0a8:0001

Same address, different text representation. The 32 IPv4 bits are split into two 16-bit hex groups instead of being shown as dotted-decimal. Some IPv6-aware tools display this form by default because it reads like a pure IPv6 address. Both forms parse to the same 128-bit value; they're interchangeable input.

3. 6to4 prefix — 2002:WWXX:YYZZ::/48

6to4 (RFC 3056) was a transition technology from the early-2000s: any IPv4 host could derive a globally-routable /48 IPv6 prefix from its public IPv4 by prepending2002: and treating its IPv4 octets as the next 32 bits. The host could then tunnel IPv6 traffic inside IPv4 packets through a 6to4 relay router to reach native IPv6 destinations. The relays were free, infrastructure was symmetric, and you could get IPv6 connectivity from an IPv4-only ISP.

6to4 worked, but it had ugly failure modes: asymmetric routing because outbound tunneling and inbound tunneling went through different relays operated by unaffiliated parties; protocol black holes when 6to4 relays got overloaded; connectivity that looked working but had 30% packet loss. RFC 7526 deprecated 6to4 in 2015. The tool still shows you the prefix because it's useful for understanding the addressing scheme historically — and because 6to4 prefix space (2002::/16) still occasionally shows up in BGP and you may want to decode it.

Going the other direction: IPv6 → IPv4

Paste an IPv6 address into the tool and we look for the IPv4-mapped pattern (top 80 bits zero, next 16 bits all-ones). If it matches, the tool surfaces the embedded IPv4 at the bottom. If the address isn't a mapped form, you get the canonical and expanded IPv6 representations instead — useful in its own right because IPv6 has many equivalent text forms and round-tripping through compress/expand confirms validity.

Common mistakes worth avoiding

  • Treating ::ffff:8.8.8.8 as a real IPv6 address that can be reached over IPv6. It cannot. The address is only meaningful inside a dual-stack socket layer where the kernel knows to fall back to IPv4 transport. An IPv6-only network has no route to it.
  • Confusing ::1.2.3.4 (IPv4-compatible) with ::ffff:1.2.3.4 (IPv4-mapped). The compatible form has been deprecated since RFC 4291 (2006). Don't use it; modern stacks usually treat it as invalid.
  • Storing the mapped form when you wanted the IPv4. Logging systems that store the raw ::ffff: form end up with their analytics treating IPv4 traffic as IPv6 traffic. Strip the prefix before storage, or normalize both families to a canonical representation per address.

Useful adjacent tools