How to use the ipv4 to ipv6 converter
- Enter an IPv4 address like
192.0.2.1into the input field. - The tool instantly displays the IPv4-mapped, NAT64, 6to4 and IPv4-compatible IPv6 representations.
- To perform IPv6 translation to IPv4, paste an IPv6 address that embeds an IPv4 address, such as
::ffff:192.0.2.1. - Review the extracted IPv4 address and the identified format in the results table.
- Use these values in your network configuration, firewall rules or application code.
How the Conversion of IPv4 to IPv6 Works
The conversion of IPv4 to IPv6 relies on embedding the 32-bit IPv4 address inside a 128-bit IPv6 address using specific prefixes defined by IETF standards. The most common method is the IPv4-mapped format specified in RFC 4291.
To calculate the mapped form, prepend ::ffff: to the dotted-decimal IPv4 address. For example, converting 192.0.2.1 yields ::ffff:192.0.2.1. Internally, this is the 96-bit zero prefix followed by 16 bits of ones (ffff) followed by the 32-bit IPv4 value.
The 6to4 format (RFC 3056) uses the prefix 2002::/16 and encodes the IPv4 address directly into hexadecimal across the next 32 bits. For 192.0.2.1, the octets in hex are c0, 00, 02, 01, grouped as c000:0201, producing 2002:c000:201::. NAT64 (RFC 6052) simply prepends the well-known prefix 64:ff9b::/96 to the IPv4 address.
Using This Tool as an IPv6 Converter to IPv4
While many tools only handle one direction, this page works as a full ipv6 converter to ipv4 as well. When you paste an IPv6 address that contains an embedded IPv4 address, the parser identifies the prefix and extracts the original four octets automatically.
For instance, pasting ::ffff:10.0.0.1 triggers the IPv4-mapped detection logic. The tool strips the ::ffff: prefix and returns 10.0.0.1. Similarly, entering 2002:c0a8:101:: signals a 6to4 address, and the hex groups c0a8 and 0101 decode back to 192.168.1.1.
This bidirectional capability makes the ipv4 to ipv6 calculator useful for debugging dual-stack applications where you frequently need to switch perspectives between address families. If you also need to work out subnet boundaries after translating addresses, pair this utility with the IPv6 subnet calculator.
Reference Table: Common IPv4 to IPv6 Conversions
This table shows how several frequently used addresses appear after conversion. You can use it to verify your own calculations or as a quick lookup.
| IPv4 Address | IPv4-mapped | 6to4 | NAT64 |
|---|---|---|---|
| 10.0.0.1 | ::ffff:10.0.0.1 | 2002:a00:1:: | 64:ff9b::10.0.0.1 |
| 172.16.0.1 | ::ffff:172.16.0.1 | 2002:ac10:1:: | 64:ff9b::172.16.0.1 |
| 192.168.1.1 | ::ffff:192.168.1.1 | 2002:c0a8:101:: | 64:ff9b::192.168.1.1 |
| 8.8.8.8 | ::ffff:8.8.8.8 | 2002:808:808:: | 64:ff9b::8.8.8.8 |
| 192.0.2.1 | ::ffff:192.0.2.1 | 2002:c000:201:: | 64:ff9b::192.0.2.1 |
When to Use Each IPv6 Format
Different transition mechanisms require different address formats. Understanding which to use prevents misconfiguration.
- IPv4-mapped (
::ffff:0:0/96): Used internally by dual-stack operating systems to represent IPv4 connections on IPv6 sockets. Your application code will encounter these when calling functions likegetpeername()on a dual-stack socket. - 6to4 (
2002::/16): A deprecated automatic tunneling mechanism where the IPv4 address of the border router is encoded in the IPv6 prefix. Still seen in legacy documentation and older network traces. - NAT64 (
64:ff9b::/96): The current standard for allowing IPv6-only clients to reach IPv4 servers through a stateful translator. Widely deployed in mobile carrier networks. - IPv4-compatible (
::/96): Deprecated since RFC 4291. Included here only for completeness when reading very old specifications.
Why Arbitrary IPv6 Addresses Cannot Convert to IPv4
A common misconception is that any IPv6 address can be translated back to IPv4. In reality, IPv6 has 128 bits of address space while IPv4 has only 32 bits. There is no mathematical way to map a general IPv6 address like 2001:db8::1 into IPv4 without losing information.
You can only convert IPv6 to IPv4 when the IPv6 address was specifically constructed to embed an IPv4 address using one of the recognized prefixes (mapped, 6to4, NAT64 or compatible). If you attempt to convert a native IPv6 address, this ipv6 converter to ipv4 returns a clear error explaining that no 1:1 conversion exists. For subnetting native IPv6 blocks, use the IPv6 subnet calculator instead.
Verifying Results Against Python ipaddress
You can verify the output of this ipv4 to ipv6 calculator against Python's built-in ipaddress module. For example, ipaddress.IPv6Address('::ffff:192.0.2.1').ipv4_mapped returns IPv4Address('192.0.2.1'). Similarly, checking ipaddress.IPv6Address('2002:c000:201::').sixtofour extracts the original IPv4 address.
Python handles the parsing of compressed IPv6 notation automatically, just as this tool does. Both follow RFC 4291 and RFC 5952 for canonical representation, ensuring that leading zeros are omitted and the longest run of consecutive zero groups is replaced with ::.
Worked examples
| Example | Input | Result |
|---|---|---|
| Standard private address | IP Address (IPv4 or IPv6): 192.168.1.1 | IPv4-mapped: ::ffff:192.168.1.1; NAT64: 64:ff9b::192.168.1.1; 6to4: 2002:c0a8:101::; IPv4-compatible: ::192.168.1.1 |
| Documentation address | IP Address (IPv4 or IPv6): 192.0.2.1 | IPv4-mapped: ::ffff:192.0.2.1; NAT64: 64:ff9b::192.0.2.1; 6to4: 2002:c000:201::; IPv4-compatible: ::192.0.2.1 |
| Extract from IPv4-mapped IPv6 | IP Address (IPv4 or IPv6): ::ffff:192.0.2.1 | Format: IPv4-mapped; Embedded IPv4: 192.0.2.1; Canonical IPv6: ::ffff:c000:201 |
| Extract from 6to4 IPv6 | IP Address (IPv4 or IPv6): 2002:c000:0204:: | Format: 6to4; Embedded IPv4: 192.0.2.4; Canonical IPv6: 2002:c000:204:: |
FAQ
What is an IPv4-mapped IPv6 address?
An IPv4-mapped address uses the prefix ::ffff:0:0/96 followed by the 32-bit IPv4 address. It allows dual-stack applications to handle IPv4 traffic using IPv6 socket APIs. For example, 192.0.2.1 becomes ::ffff:192.0.2.1.
Can I convert any IPv6 address to IPv4?
No. Only IPv6 addresses that explicitly embed an IPv4 address using a known prefix like ::ffff:, 2002: or 64:ff9b:: can be converted back. Native IPv6 addresses have no equivalent IPv4 representation because the address spaces differ in size.
What is the difference between NAT64 and 6to4?
NAT64 uses the 64:ff9b::/96 prefix and relies on a stateful translator to bridge IPv6 clients to IPv4 servers. 6to4 uses the 2002::/16 prefix and creates automatic tunnels between IPv6 islands over an IPv4 network, though 6to4 is now largely deprecated.
Is the IPv4-compatible IPv6 format still used?
No. The IPv4-compatible format (::a.b.c.d) was deprecated by RFC 4291 in 2006. Modern systems should use IPv4-mapped addresses instead. This tool includes it only for reference when working with legacy documentation.
How do I read a 6to4 IPv6 address?
Take the 32 bits immediately following the 2002: prefix and split them into four 8-bit octets. For 2002:c000:201::, the hex c000:0201 translates to decimal octets 192.0.2.1.
Does this tool work offline?
Yes. All parsing and formatting logic runs locally in your browser. No IP addresses are sent to any server, making it safe to use with internal or sensitive network configurations.
What does the conversion IPv4 to IPv6 produce?
The conversion IPv4 to IPv6 embeds the 32-bit address in a 128-bit one. This tool shows four forms: IPv4-mapped (::ffff:a.b.c.d), 6to4 (2002::/16), NAT64 (64:ff9b::/96) and the deprecated IPv4-compatible form.