ToolNestr

IPv4 to IPv6 Converter

Enter an IPv4 address to see it converted into two standard IPv6 representations: the IPv4-mapped format (::ffff/96) and the 6to4 format (2002::/16).

Reviewed by the ToolNestr Editorial Team — July 2026

Enter an IPv4 address

How IPv4 to IPv6 conversion works

IPv4 and IPv6 are fundamentally different protocols with incompatible address formats. An IPv4 address is 32 bits, written as four decimal octets. An IPv6 address is 128 bits, written as eight hexadecimal groups. To make them interoperable, several standards define ways to embed an IPv4 address inside an IPv6 address. This converter implements two of the most common: IPv4-mapped IPv6 addresses and 6to4 addresses.

The IPv4-mapped format, defined in RFC 4291, places the 32-bit IPv4 address in the lowest 32 bits of the IPv6 address. The first 80 bits are zero, and the next 16 bits are set to one (0xFFFF), resulting in the prefix ::ffff:0:0/96. For example, 192.0.2.1 becomes ::ffff:192.0.2.1 — or in fully expanded hex notation, 0000:0000:0000:0000:0000:ffff:c000:0201.

The 6to4 format, standardized in RFC 3056, uses the prefix 2002::/16 (which corresponds to the binary value 0010 0000 0000 0010 in the first 16 bits). The next 32 bits carry the IPv4 address, leaving 80 bits for subnet and interface identifier. For the IPv4 address 192.0.2.1, the hex conversion of 192=C0, 0=00, 2=02, 1=01 gives 2002:c000:0201::1. The trailing ::1 represents the standard IPv6 solicited-node multicast interface identifier.

IPv4 to IPv6 Embedding Structure Diagram showing how a 32-bit IPv4 address is embedded into a 128-bit IPv6 address in both ::ffff and 2002:: formats IPv4 Address: 192.168.1.1 192 168 1 1 4 octets = 32 bits total Mapped (::ffff/96) 80 bits zeros + 16 bits ffff 192.168.1.1 Subnet + IID 6to4 (2002::/16) 2002 prefix c0a8:0101 Subnet Interface ID
An IPv4 address is embedded into the last 32 bits of a ::ffff IPv6 address or into bits 16-47 of a 2002:: 6to4 address

IPv4-mapped IPv6 addresses in detail

The IPv4-mapped IPv6 address format was defined in RFC 4291 (IP Version 6 Addressing Architecture) to support the transition from IPv4 to IPv6. The structure is 80 bits of zeros, followed by 16 bits of ones (0xFFFF), followed by the 32-bit IPv4 address. In standard notation, this is written as ::ffff:192.0.2.1. The address is never used as a source or destination in an IPv6 packet header — it exists only as an internal representation within the socket API layer of dual-stack operating systems.

The practical use of ::ffff addresses is invisible to most users but essential for software developers. When a server application creates an IPv6 listening socket with the IPV6_V6ONLY flag set to false, the operating system automatically maps incoming IPv4 connections to ::ffff addresses. This allows the server to handle both IPv4 and IPv6 clients with a single socket. Without this mechanism, servers would need to maintain separate IPv4 and IPv6 listeners, doubling the complexity of network service code.

It is important to distinguish IPv4-mapped addresses from IPv4-compatible addresses (::/96 with zeros instead of ffff), which were used in earlier transition mechanisms but have been deprecated by RFC 4291. The ::ffff/96 prefix specifically uses the 16-bit field of all ones to indicate that the address is an IPv4-mapped address. This eliminates ambiguity and simplifies the handling of these addresses in routing and forwarding decisions.

The 6to4 tunneling mechanism

6to4 was designed as an automatic tunneling mechanism that allows isolated IPv6 sites to communicate over the existing IPv4 internet without manual tunnel configuration. Defined in RFC 3056, it assigns every public IPv4 address a corresponding /48 IPv6 prefix derived by prepending the IPv4 address to the 2002::/16 prefix. An organization with the IPv4 address 192.0.2.1 gets the 6to4 prefix 2002:c000:0201::/48, which provides 65,535 /64 subnets for their internal network.

The encapsulation process is straightforward: the 6to4 router takes an IPv6 packet destined for a 2002:: address, strips the 2002:: prefix to extract the destination IPv4 address, then encapsulates the entire IPv6 packet in an IPv4 packet with protocol type 41. On the receiving end, the 6to4 router decapsulates the packet and forwards the inner IPv6 packet to its final destination. This tunneling is automatic because the destination IPv4 address is embedded directly in the IPv6 destination address — no configuration or mapping table is needed.

While 6to4 was an important stepping stone in IPv6 deployment, it has fallen out of favor due to several limitations. Many firewalls block protocol 41 traffic, and the reliance on IPv4 anycast for 6to4 relay routers introduced reliability and performance issues. The IETF now recommends native IPv6 connectivity or manually configured tunnels over 6to4. However, the 2002:: prefix remains a valid address format for educational purposes and legacy systems.

When to use each format

::ffff/96 (IPv4-Mapped)

Use when developing or debugging dual-stack network applications. This format appears in log files, socket API calls, and debugging tools like netstat when IPv6 sockets accept IPv4 connections. It is not used for actual packet transmission.

2002::/16 (6to4)

Use when configuring 6to4 tunnels for IPv6 connectivity across IPv4-only infrastructure. This format is used in router configurations and represents a routable IPv6 prefix. It enables IPv6 communication without native IPv6 from your ISP.

Native IPv6

Always prefer native IPv6 (2001::/16 and other global unicast prefixes) when available. Native connectivity avoids the overhead and reliability issues of tunneling and provides full IPv6 performance. Check with your ISP about native IPv6 support.

Transition technologies and the future

The transition from IPv4 to IPv6 has been underway for over two decades. Various mechanisms have been developed to ensure interoperability during the transition period, which has lasted much longer than originally anticipated. Besides IPv4-mapped addresses and 6to4, other notable transition technologies include Teredo (RFC 4380), which tunnels IPv6 over UDP through NAT devices, and DNS64/NAT64 (RFC 6146), which allows IPv6-only clients to access IPv4-only servers through protocol translation.

As of the mid-2020s, global IPv6 adoption exceeds 40% in many regions, with some countries and ISPs exceeding 70%. Major content providers including Google, Facebook, Netflix, and Cloudflare serve the majority of their traffic over IPv6. As native IPv6 becomes ubiquitous, the need for transition mechanisms and IPv4-to-IPv6 conversion tools diminishes. However, understanding these formats remains essential for network professionals working with legacy systems and during the continuing coexistence period.

Frequently asked questions

What is an IPv4-mapped IPv6 address?

An IPv4-mapped IPv6 address embeds an IPv4 address into the lower 32 bits of a 128-bit IPv6 address using the ::ffff/96 prefix. For example, ::ffff:192.0.2.1 represents the IPv4 address 192.0.2.1. This format is used by dual-stack applications to represent IPv4 connections over an IPv6 socket API.

What is a 6to4 address?

6to4 is a tunneling mechanism defined in RFC 3056 that allows IPv6 packets to be transmitted over an IPv4 network. It uses the 2002::/16 prefix and embeds the IPv4 address in the next 32 bits. For example, 2002:c000:0201::1 corresponds to 192.0.2.1.

Why are there two different IPv6 formats for IPv4 addresses?

The ::ffff format is used for compatibility in dual-stack software — it lets IPv6-only applications handle IPv4 connections. The 2002:: format is a tunneling mechanism that encapsulates IPv6 packets inside IPv4 packets. They serve different purposes in the protocol stack.

Can all IPv4 addresses be converted to IPv6?

Yes — any IPv4 address can be represented in both ::ffff and 2002:: formats. However, these are representations, not protocol-level equivalents. An IPv4-only host cannot communicate with an IPv6-only host through address conversion alone — translation or tunneling is required.

What is the ::ffff:0:0/96 prefix?

The ::ffff:0:0/96 prefix (also written as ::ffff/96) is reserved by RFC 4291 for IPv4-mapped IPv6 addresses. The first 80 bits are zero, the next 16 bits are all ones (ffff), and the last 32 bits contain the IPv4 address. These addresses are never used as source or destination addresses on the wire — they exist only within socket APIs.

Is 6to4 still used today?

6to4 was widely used in the early days of IPv6 deployment but has largely been replaced by native IPv6, Teredo, and 6in4 tunnels. Many networks now block 6to4 due to security concerns and reliability issues. However, the 2002:: prefix remains a valid representation for converting IPv4 addresses to IPv6 format.

How is the IPv4 address embedded in 6to4?

In 6to4, the 32-bit IPv4 address is placed in bits 16 to 47 of the IPv6 address. The IPv4 octets are converted to hexadecimal and placed in the second and third hextets. For example, 192.0.2.1 becomes c000:0201 in the 2002:: prefix.

What is the purpose of IPv4-mapped addresses?

IPv4-mapped IPv6 addresses allow applications written to the IPv6 socket API to handle connections from IPv4 clients transparently. When a dual-stack server listens on an IPv6 socket, incoming IPv4 connections are presented as ::ffff:x.x.x.x addresses, eliminating the need for separate IPv4 and IPv6 listeners.

All tool categories

Networking & IP Tools (36 tools)
🧮 Everyday (26 tools)
💪 Health & Fitness (30 tools)
💰 Finance (34 tools)
🔢 Math (23 tools)
📄 PDF Tools (10 tools)
🎨 Creators (12 tools)
💻 Developers (24 tools)
⚡ Engineering & Science (24 tools)
⚛️ Physics (48 tools)
🧪 Chemistry (50 tools)
🧬 Biology (50 tools)
🏠 Construction & Home Improvement (105 tools)
👗 Clothing & Garment Tools (68 tools)
🍳 Cooking & Baking (9 tools)
🚗 Automotive (26 tools)
🖼️ Image Tools (13 tools)
🔐 Security & Hash (15 tools)
📝 Text Tools (15 tools)
🔍 SEO Tools (11 tools)
🔄 Converters (69 tools)
🕐 Time & Date (15 tools)
📊 Chart Generators (11 tools)
🕌 Islamic Tools (16 tools)