IPv4 ↔ IPv6 Converter
Convert between IPv4 and IPv6 in every common format: IPv4-mapped IPv6 (::ffff:1.2.3.4), 6to4 (2002:...), full and compressed IPv6 notation, decimal/hex integer forms, reverse-DNS arpa names, and more.
How to Use
- Type any IPv4 (e.g., <code>8.8.8.8</code>) or IPv6 address into the input.
- Direction is auto-detected — IPv4 inputs produce IPv6 forms; IPv6 inputs produce the IPv4 if extractable.
- See multiple representations at once: full vs compressed IPv6, IPv4-mapped, 6to4, integer forms (decimal and hex), and reverse-DNS PTR names.
- Click any output to copy.
- Use one of the preset buttons for common examples (Google DNS, Cloudflare, localhost, etc.).
- Everything runs in your browser.
Address Representations
A Brief History of IPv6 Transition
IPv6 was first specified in 1995 (RFC 1883) — over 30 years before this writing — to replace IPv4 before its address space was exhausted. IANA assigned the last unallocated /8 of IPv4 in 2011; regional registries depleted shortly after. Despite that pressure, IPv6 deployment has been gradual: as of 2026, Google reports about 50% of users reach it over IPv6, with major variation by country and ISP.
The transition required mechanisms to let IPv4 and IPv6 coexist and translate. The early efforts — 6to4 (RFC 3056, 2001), Teredo (RFC 4380, 2006), ISATAP (RFC 5214, 2008) — were tunneling protocols that put IPv6 packets inside IPv4 packets. They worked but had performance, reliability, and routing problems; most are now deprecated or obscure.
The modern approach is dual-stack (run both protocols natively in parallel) and NAT64/DNS64 (RFC 6052/6147, 2011) for IPv6-only client networks that still need to reach the IPv4 internet. The IPv4-mapped IPv6 form (::ffff:0:0/96) remains useful internally for dual-stack programming but is not routed on the public internet. Reverse-DNS PTR records moved from in-addr.arpa to a parallel ip6.arpa tree.
About This Converter
This converter parses an IPv4 or IPv6 input and computes every common representation: integer/hex forms, full and compressed IPv6 (RFC 5952 canonical), IPv4-mapped, 6to4, NAT64 well-known prefix, and reverse-DNS PTR names. Direction is auto-detected. For IPv6 inputs that don't have an extractable IPv4 component (most native IPv6 addresses), only the IPv6 representations are produced.
Everything runs in your browser using BigInt (for IPv6's 128-bit integer representation) and bitwise operations (for the 32-bit IPv4 portions). No values are transmitted.
Frequently Asked Questions
What's an IPv4-mapped IPv6 address?
An IPv6 representation of an IPv4 address using the prefix <code>::ffff:0:0/96</code>. The IPv4 address fills the last 32 bits. <code>192.0.2.1</code> becomes <code>::ffff:192.0.2.1</code> or equivalently <code>::ffff:c000:201</code>. Used internally by dual-stack network code so a single socket can handle both protocols. RFC 4291 covers the format.
What's 6to4?
An IPv6 transition mechanism (RFC 3056) that uses the prefix <code>2002::/16</code> followed by the embedded IPv4 address (32 bits) to create a unique IPv6 prefix per IPv4 address. So <code>192.0.2.1</code> becomes <code>2002:c000:201::/48</code>. 6to4 was widely deployed in the 2000s but has fallen out of favor due to relay-router issues; modern IPv6 deployment prefers native dual-stack.
Why are there multiple ways to write IPv6?
The full form is verbose: <code>2001:0db8:0000:0000:0000:0000:0000:0001</code>. RFC 5952 defines the canonical compressed form: leading zeros stripped from each group, longest run of zero groups replaced with <code>::</code>, lowercase. The same address becomes <code>2001:db8::1</code>. Both refer to the same address; the compressed form is preferred for display.
Can every IPv6 address be converted to IPv4?
No — IPv6 has 2<sup>128</sup> addresses; IPv4 has 2<sup>32</sup>. Only IPv6 addresses with the IPv4-mapped, IPv4-translated, IPv4-compatible, or 6to4 prefix can be reduced to a corresponding IPv4. The vast majority of native IPv6 addresses have no IPv4 equivalent.
What's a reverse-DNS PTR name?
The DNS record type used to look up a name from an IP address (the reverse of A/AAAA). IPv4 PTRs use the <code>in-addr.arpa</code> tree with octets in reverse order: <code>8.8.8.8</code> → <code>8.8.8.8.in-addr.arpa</code>. IPv6 PTRs use <code>ip6.arpa</code> with each nibble reversed and dotted: <code>2001:db8::1</code> → <code>1.0.0.0...8.b.d.0.1.0.0.2.ip6.arpa</code>. Used by traceroute, mail server validation, and many logging tools.
What's the difference between IPv4-mapped, IPv4-translated, and 6to4?
<strong>IPv4-mapped</strong> (::ffff:0:0/96) — represents an IPv4 address on a dual-stack socket (RFC 4291). <strong>IPv4-translated</strong> (::ffff:0:0:0/96) — historical, deprecated. <strong>IPv4-compatible</strong> (::/96) — also deprecated; old representation that conflicted with the IPv4-mapped scheme. <strong>6to4</strong> (2002::/16) — embeds the IPv4 address in a globally-routable IPv6 prefix. Modern code uses IPv4-mapped only.
What about NAT64 / DNS64?
NAT64 uses the well-known prefix <code>64:ff9b::/96</code> (RFC 6052) to embed IPv4 addresses for use by IPv6-only clients. DNS64 synthesizes AAAA records from existing A records by prepending this prefix. The conversion math is the same as IPv4-mapped — embed the 32-bit IPv4 address in the last 32 bits of an IPv6 prefix.
Common Use Cases
Network programming
Compute IPv4-mapped form when initializing a dual-stack socket or generating sockaddr_in6 structures.
IPv6 transition planning
Look up the 6to4 or NAT64 form of an IPv4 address when designing a transition strategy.
Reverse DNS configuration
Generate the correct in-addr.arpa or ip6.arpa zone name for PTR record setup.
Log analysis
Identify and normalize IPs across logs that may use different representations of the same address.
Education
See multiple equivalent representations of the same address — useful for understanding how IPv6 maps onto IPv4.
CIDR documentation
Generate the canonical compressed form of a network prefix for clean documentation.
Last updated: