BYTETOOLS

IPv6 to IPv4 Converter

Pull the IPv4 address out of an IPv6 address and name the mechanism — IPv4-mapped, 6to4, Teredo, NAT64, ISATAP — or explain when there is none.

192.0.2.45
Embedded IPv4
Teredo address
Mechanism

Teredo address (2001:0::/32)

192.0.2.45

Teredo tunnels IPv6 through a NAT over UDP. The Teredo server's IPv4 address is stored in the clear, while the client's IPv4 address and UDP port are stored bitwise-inverted so NAT devices do not rewrite them.

Details

Teredo server IPv4
65.54.227.120
Client IPv4 (after XOR 0xffffffff)
192.0.2.45
Client UDP port (after XOR 0xffff)
40000
Flags
0x8000 — cone NAT bit set
Defined by
RFC 4380
Compressed form
2001:0:4136:e378:8000:63bf:3fff:fdd2
Expanded form
2001:0000:4136:e378:8000:63bf:3fff:fdd2

What is the IPv6 to IPv4 Converter?

Several IPv6 transition mechanisms carry an IPv4 address inside the 128 bits, each in a different place.

  • Recognises IPv4-mapped, IPv4-translated, IPv4-compatible, 6to4, Teredo, NAT64 and ISATAP formats
  • Un-obfuscates Teredo client addresses and ports and decodes the flags field
  • Shows the derived 6to4 /48 site prefix
  • Says clearly when an address carries no IPv4 rather than inventing one
  • Displays the compressed and expanded forms of whatever you paste
  • Entirely offline — no DNS lookups, no API calls, nothing uploaded

How to use the IPv6 to IPv4 Converter

  1. 1

    Paste an IPv6 address into the input box.

  2. 2

    Read the mechanism it was recognised as and the IPv4 address extracted from it.

  3. 3

    Check the details panel for extras such as the Teredo server, UDP port and flags, or the 6to4 site prefix.

  4. 4

    Copy the IPv4 address with the copy button.

About the IPv6 to IPv4 Converter

Several IPv6 transition mechanisms carry an IPv4 address inside the 128 bits, each in a different place. This converter recognises IPv4-mapped ::ffff:a.b.c.d addresses, IPv4-compatible ::a.b.c.d, 6to4 in 2002::/16, Teredo in 2001:0::/32, the NAT64 well-known prefix 64:ff9b::/96 and ISATAP interface identifiers, and extracts the IPv4 address from whichever one applies.

Teredo gets special treatment because it is the awkward one: the server's IPv4 address is stored in the clear, while the client's address and UDP port are stored bit-inverted so that NAT devices do not rewrite them. The tool un-inverts both and shows the flags byte as well.

Just as importantly, it says plainly when an address contains no IPv4 at all — a native global unicast address is not derived from IPv4 and there is nothing to extract. Everything is computed 100% locally in your browser with no lookups of any kind.

Frequently asked questions

Can any IPv6 address be converted to IPv4?

No. Only addresses from transition mechanisms carry an IPv4 address inside them. A native global unicast address such as 2606:4700::1111 was allocated independently and has no IPv4 equivalent — the only way to relate the two is a DNS lookup of the hostname.

What does ::ffff:192.168.1.1 mean?

That is an IPv4-mapped IPv6 address. Dual-stack sockets use this notation so an application listening on IPv6 can represent an IPv4 peer. The packet on the wire is ordinary IPv4; only the API representation is IPv6.

How do I read a 6to4 address?

In a 2002::/16 address the next 32 bits are the site's public IPv4 address in hex. So 2002:c000:0204:: contains c0.00.02.04 = 192.0.2.4. 6to4 was deprecated by RFC 7526 but still appears in old configs and packet captures.

Why are Teredo addresses XOR-ed?

Because NAT devices rewrite any IPv4 address or port they recognise in a packet. Storing the client address inverted with 0xffffffff and the port inverted with 0xffff hides them from that rewriting. To read them you invert them back, which this tool does for you.

What is the 64:ff9b:: prefix?

It is the well-known prefix a NAT64 gateway uses to synthesise IPv6 addresses for IPv4-only servers, defined in RFC 6052. With the /96 form the IPv4 address sits unshifted in the last 32 bits, so 64:ff9b::192.0.2.33 simply means 192.0.2.33.

Related tools