IPv4 to IPv6 Converter - Full, Compressed & Mapped Notation
Convert IPv4 addresses to IPv6 format instantly. Get full expanded, compressed (RFC 5952), mapped, and 6to4 representations with one click.
About
Every IPv4 address can be represented as an IPv6 address through well-defined mapping mechanisms specified in RFC 4291 and RFC 6052. The most common is the IPv4-mapped IPv6 address, which embeds the 32-bit IPv4 address in the lower 32 bits of a 128-bit IPv6 address, prefixed by 80 zero bits and 16 one bits (::ffff:). A misconfigured mapping leads to routing failures, broken dual-stack applications, and DNS resolution errors that are notoriously difficult to debug. This tool computes four distinct representations: the full expanded 128-bit notation, the RFC 5952 compressed form, the mixed notation preserving dotted-decimal readability, and the 6to4 tunnel address (prefix 2002:: per RFC 3056). It validates each octet against the 0 - 255 range and rejects malformed input before conversion. The tool approximates standard mapping behavior and does not account for NAT64 prefix customization or provider-specific Teredo server addresses.
Formulas
An IPv4 address A.B.C.D maps to a 128-bit IPv6 address as follows:
IPv6mapped = 0000:0000:0000:0000:0000:ffff:hex(A)hex(B):hex(C)hex(D)
Each octet is converted to its 2-digit hexadecimal equivalent:
hex(octet) = octet.toString(16).padStart(2, "0")
For the 6to4 representation (RFC 3056):
IPv66to4 = 2002:hex(A)hex(B):hex(C)hex(D)::
Compression (RFC 5952) removes leading zeros from each group and replaces the longest consecutive run of all-zero groups with ::. Only one :: is permitted per address.
Where A, B, C, D = decimal octets, each โ [0, 255]. ffff = the 16-bit marker indicating an IPv4-mapped address.
Reference Data
| IPv6 Notation Type | Format Example | RFC | Use Case |
|---|---|---|---|
| Full Expanded | 0000:0000:0000:0000:0000:ffff:c0a8:0101 | RFC 4291 | Canonical storage, log parsing |
| Compressed (RFC 5952) | ::ffff:c0a8:101 | RFC 5952 | Configuration files, display |
| Mixed Notation | ::ffff:192.168.1.1 | RFC 4291 ยง2.2 | Dual-stack sockets, readability |
| 6to4 Tunnel | 2002:c0a8:0101:: | RFC 3056 | 6to4 relay routing |
| Teredo (Template) | 2001:0000:<server>:<flags>:<port>:<client> | RFC 4380 | NAT traversal tunneling |
| IPv4-Compatible (Deprecated) | ::192.168.1.1 | RFC 4291 | Historic, not recommended |
| NAT64 Well-Known Prefix | 64:ff9b::192.168.1.1 | RFC 6052 | Stateful NAT64 translation |
| Loopback IPv4 | 127.0.0.1 โ ::ffff:7f00:1 | - | Local testing |
| Broadcast IPv4 | 255.255.255.255 โ ::ffff:ffff:ffff | - | Edge case validation |
| Private Class A | 10.0.0.0 - 10.255.255.255 | RFC 1918 | Internal networks |
| Private Class B | 172.16.0.0 - 172.31.255.255 | RFC 1918 | Internal networks |
| Private Class C | 192.168.0.0 - 192.168.255.255 | RFC 1918 | Home / small office |
| APIPA | 169.254.0.0 - 169.254.255.255 | RFC 3927 | Link-local auto-config |
| Multicast | 224.0.0.0 - 239.255.255.255 | RFC 5771 | Group communication |
| IPv4 Address Space | 32 bits โ ~4.3 billion | - | Exhausted (IANA 2011) |
| IPv6 Address Space | 128 bits โ ~3.4 ร 1038 | - | Effectively unlimited |