IPv6 to IPv4 Converter

Get the IPv4 address embedded in an IPv6 address, such as ::ffff:192.0.2.1 or 64:ff9b::192.0.2.33. Supports IPv4-mapped, NAT64, 6to4, Teredo and IPv4-compatible formats.

Auto-Detect
5 Formats
Batch up to 100
🌐
6to4 Tunnel
🔄
NAT64
🚇
Teredo
🗺️
IPv4-Mapped
Powered by orbit2x.com
Ctrl+Enter to convert
Converting IPv6 to IPv4...
Convert several addresses at once (up to 100)

Each address is auto-detected. Addresses without an embedded IPv4 address are listed with the reason.

Converting…

Extract the IPv4 Address Inside an IPv6 Address

Some IPv6 addresses carry an IPv4 address inside them. You'll see them in server logs (::ffff:203.0.113.7), on IPv6-only mobile networks (64:ff9b::…) and in old tunnelling setups. This tool recognises five of these formats and pulls out the IPv4 address.

Most IPv6 addresses don't contain one. An ordinary address such as 2001:db8:85a3::8a2e:370:7334 is unrelated to any IPv4 address, so there's nothing to convert, and no tool can produce one. If you want the IPv4 address of a website or server, look up its A record with a DNS lookup instead.

How to Use the Converter

  1. Paste an IPv6 address. Brackets, surrounding spaces and a zone index such as %eth0 are removed, so you can paste straight from a log or URL.
  2. Leave Auto-Detect selected to recognise the format from its prefix, or pick a format to check the address against that one only.
  3. Convert to see the IPv4 address, the format found and the RFC that defines it.
  4. To convert a list, open Convert several addresses at once and paste up to 100 addresses, one per line.

Addresses are sent to the Orbit2x server to be decoded and aren't saved.

Supported Formats

IPv6 formats that contain an IPv4 address, with an example of each
FormatExampleIPv4 resultWhere the IPv4 address is
IPv4-mapped
::ffff:0:0/96
::ffff:192.0.2.1192.0.2.1Last 32 bits. How dual-stack software and server logs show an IPv4 client on an IPv6 socket.
NAT64
64:ff9b::/96
64:ff9b::192.0.2.33192.0.2.33Last 32 bits. Used by IPv6-only networks, including many mobile carriers, to reach IPv4 servers.
6to4
2002::/16
2002:c000:0204::1192.0.2.4The 32 bits after 2002. A tunnelling method that is now deprecated.
Teredo
2001::/32
2001:0000:4136:e378:8000:63bf:3fff:fdd265.54.227.120 (server) and 192.0.2.45 (client)Server in bits 32–63, client in the last 32 bits with every bit inverted.
IPv4-compatible
::/96
::192.0.2.1192.0.2.1Last 32 bits. Deprecated since 2006 and rarely seen.

How the Conversion Works

An IPv4 address is 32 bits, which is exactly two groups of an IPv6 address. Converting means reading those two groups as four bytes. For 64:ff9b::c000:221:

c000 → c0 . 00  → 192 . 0 0221 → 02 . 21  →   2 . 33 Result: 192.0.2.33

Teredo is the one format that needs an extra step. The client address is stored with every bit inverted (XOR with ffff:ffff), so 3fff:fdd2 becomes c000:022d, which is 192.0.2.45. The client's UDP port is stored the same way: 63bf inverted is 9c40, port 40000.

Limitations

  • NAT64 is recognised only with the well-known prefix 64:ff9b::/96. Networks that use their own NAT64 prefix, or the local-use prefix 64:ff9b:1::/48, aren't detected.
  • ISATAP and other tunnelling formats aren't supported.
  • Picking a format checks the prefix. An address that doesn't match the chosen format gets an error rather than a guess.
  • ::1 is the IPv6 loopback address (the equivalent of 127.0.0.1) and :: is the unspecified address. Neither contains an IPv4 address.

Frequently Asked Questions

Can any IPv6 address be converted to IPv4?

No. IPv6 has far more addresses than IPv4, and almost all of them have no IPv4 equivalent. Only the special formats listed above carry an IPv4 address. For anything else, the converter says that no IPv4 address is embedded.

Why do my server logs show addresses like ::ffff:203.0.113.7?

The server is listening on an IPv6 socket that also accepts IPv4 connections. The operating system writes each IPv4 client as an IPv4-mapped IPv6 address. The real client address is the part after ::ffff:, here 203.0.113.7.

What's the difference between IPv4-mapped and IPv4-compatible?

Both put the IPv4 address in the last 32 bits. IPv4-mapped (::ffff:a.b.c.d) is in everyday use for dual-stack sockets. IPv4-compatible (::a.b.c.d) was meant for an early transition method and was deprecated in RFC 4291.

Why does a Teredo address give two IPv4 addresses?

A Teredo address records both the Teredo server the client registered with and the client's own public IPv4 address, as seen through its NAT. The converter shows both, labelled.

Can I convert IPv4 to IPv6?

The IPv4-mapped form is simply ::ffff: followed by the IPv4 address, so 192.0.2.1 becomes ::ffff:192.0.2.1. That's a representation, not a real IPv6 address you can route to; a host's actual IPv6 address is assigned separately and is found in its AAAA DNS record.

Standards

RFC 4291 (IPv4-mapped and IPv4-compatible), RFC 6052 (NAT64), RFC 3056 (6to4, deprecated by RFC 7526), RFC 4380 (Teredo).

Related Tools