Skip to content

IPv6 to IPv4 Converter

Brackets, a /prefix length and a %zone suffix are ignored.

IPv4 address (first line) —
Address type
—
Lines with an IPv4 inside
—
Lines read
—

An IPv6 address only converts to IPv4 when it carries one inside. Paste it and the converter reads the embedded 32 bits: ::ffff:c000:201 gives 192.0.2.1, 64:ff9b::c000:221 gives 192.0.2.33, and 2002:c000:204::1 gives 192.0.2.4. A native address such as 2001:db8::1 has no IPv4 equivalent, and the tool says so.

About this tool

Server logs, firewall rules and DNS64 answers often show IPv4 clients wearing an IPv6 disguise. A dual-stack socket logs 192.0.2.1 as ::ffff:192.0.2.1, a NAT64 gateway hands out 64:ff9b::c000:221, and an old 6to4 or Teredo tunnel hides the IPv4 inside the prefix or bit-inverted at the end. This converter expands each address, recognises which of those five formats it is, and prints the IPv4 address with the type next to it. Paste a single address or a whole column of them, one per line, or open a text file. The limit is fundamental: most IPv6 addresses are assigned natively and contain no IPv4 at all, so there is nothing to translate and no lookup can invent one.

How to use it

  1. Enter addresses

    Type or paste IPv6 addresses one per line, or open a .txt or .csv file from your device.

  2. Read the first result

    The headline shows the IPv4 for the first line and its address type.

  3. Check the table

    Every line gets a row with its IPv4, or Invalid, or None embedded for native IPv6.

  4. Follow the working

    The steps show each address fully expanded and which bits were read.

Examples

A Teredo address

IPv6 addresses
2001:0000:4136:e378:8000:63bf:3fff:fdd2

Result IPv4 address (first line): 192.0.2.45
Address type: Teredo (2001::/32)
Lines with an IPv4 inside: 1
Lines read: 1

  1. 2001:0000:4136:e378:8000:63bf:3fff:fdd2 expands to 2001:0:4136:e378:8000:63bf:3fff:fdd2 → Teredo (2001::/32): last 32 bits XOR ffff:ffff (client); server is 65.54.227.120 → 192.0.2.45.

The client IPv4 is stored bit-inverted in the last 32 bits; flipping every bit back gives 192.0.2.45.

A NAT64 address from a DNS64 resolver

IPv6 addresses
64:ff9b::c000:221

Result IPv4 address (first line): 192.0.2.33
Address type: NAT64 (64:ff9b::/96)
Lines with an IPv4 inside: 1
Lines read: 1

  1. 64:ff9b::c000:221 expands to 64:ff9b:0:0:0:0:c000:221 → NAT64 (64:ff9b::/96): last 32 bits after the 64:ff9b::/96 prefix → 192.0.2.33.

The well-known prefix 64:ff9b::/96 wraps the IPv4 in its last 32 bits, here c000:0221.

A mixed list of four lines

IPv6 addresses
::ffff:192.0.2.1 2002:c000:0204::1 2001:db8::1 not-an-address

Result IPv4 address (first line): 192.0.2.1
Address type: IPv4-mapped
Lines with an IPv4 inside: 2
Lines read: 4

  1. ::ffff:192.0.2.1 expands to 0:0:0:0:0:ffff:c000:201 → IPv4-mapped: last 32 bits after ::ffff: → 192.0.2.1.
  2. 2002:c000:0204::1 expands to 2002:c000:204:0:0:0:0:1 → 6to4 (2002::/16): groups 2 and 3, right after 2002: → 192.0.2.4.
  3. 2001:db8::1 expands to 2001:db8:0:0:0:0:0:1 → Native IPv6: no IPv4 is carried in this address → None embedded.

A mapped and a 6to4 address both yield IPv4; the documentation address 2001:db8::1 is native IPv6 and the last line is skipped.

How it is calculated

IPv4 = bits 96–127 (mapped, compatible, NAT64); bits 16–47 (6to4); bits 96–127 XOR ffffffff (Teredo client)

::ffff:0:0/96
IPv4-mapped prefix from RFC 4291
64:ff9b::/96
NAT64 well-known prefix from RFC 6052
2002::/16
6to4 prefix from RFC 3056, followed by the 32-bit IPv4
2001::/32
Teredo prefix from RFC 4380; server IPv4 in bits 32–63, client IPv4 inverted in the last 32 bits

Each line is expanded to eight 16-bit groups, filling :: with zeros and folding a trailing dotted quad into two groups. The prefix decides where the IPv4 sits. Mapped, compatible and NAT64 addresses keep it in the last two groups; 6to4 keeps it in groups two and three; Teredo stores the client address with every bit flipped, so the tool inverts it back. Anything else is reported as native IPv6.

When not to use it

  • To find which IPv4 a dual-stack host also uses, query its DNS A record instead; the IPv6 address alone does not reveal it.
  • NAT64 deployments with a network-specific prefix other than 64:ff9b::/96 place the IPv4 differently and are not decoded here.

Common mistakes

  • Expecting every IPv6 address to have an IPv4 twin; native addresses simply do not.
  • Reading the Teredo client address straight from the last groups without inverting the bits.
  • Confusing 2001:db8::/32 documentation addresses with Teredo's 2001:0::/32 prefix.

Frequently asked questions

Why does my log show ::ffff: before an IPv4 address?

A server listening on an IPv6 socket that also accepts IPv4 reports IPv4 clients as IPv4-mapped addresses. The client really connected over IPv4; the last 32 bits are its address.

Can any IPv6 address be turned into IPv4?

No. IPv6 has 128 bits and IPv4 has 32, so only addresses built to carry an IPv4 can be reversed. A native global address such as one from your ISP has no IPv4 inside it.

What does 64:ff9b:: mean?

It is the NAT64 well-known prefix. A DNS64 resolver synthesises these addresses for IPv4-only sites so IPv6-only clients can reach them through a translator. The last 32 bits are the site's real IPv4 address.

How is the Teredo client address hidden?

RFC 4380 stores the client's public IPv4 in the last 32 bits with every bit inverted, so 3fff:fdd2 becomes 192.0.2.45 after an XOR with ffff:ffff. The Teredo server's IPv4 sits unmodified in the third and fourth groups.

Are IPv4-compatible addresses still used?

No. The ::a.b.c.d form was deprecated by RFC 4291 in 2006. The tool still decodes it because old configurations and textbooks show it, and labels it as deprecated.

Does it accept brackets or a prefix length?

Yes. Square brackets from URLs, a /64-style prefix length and a %eth0 zone suffix are stripped before the address is parsed.