Skip to content
Toova
All Tools

IPv4 ↔ IPv6 Converter

Private by design — runs entirely in your browser

Switch direction and paste an IPv4 like 192.0.2.1 to see the IPv4-mapped (::ffff:192.0.2.1), full-expanded, and IPv4-compatible IPv6 forms. Switch to IPv6 → IPv4 to pull the embedded IPv4 out of a mapped address, or to see the compressed and expanded form of any IPv6.

Three IPv4-in-IPv6 representations

RFC 4291 defines two ways to express an IPv4 address inside an IPv6 address. The current one is IPv4-mapped: ::ffff:a.b.c.d. The older one is IPv4-compatible: ::a.b.c.d, deprecated for new code but still found in old documentation and some legacy stacks. We also output the full expanded form (eight 16-bit hex groups, no shortcuts) which is what you want when grepping logs or matching addresses byte-for-byte.

Compressed versus expanded notation

IPv6 supports a textual shorthand: the longest consecutive run of all-zero 16-bit groups can be replaced with a single ::. So 2001:db8:0:0:0:0:0:1 becomes 2001:db8::1. The :: can appear at most once in an address. RFC 5952 codifies the rules — lower-case hex, compress only the longest run, drop leading zeros within each group. The compressed form is what you should publish; the expanded form is what tools like ipset or BPF need.

Why dual-stack debugging matters

When a server listens on an AF_INET6 socket with IPV6_V6ONLY disabled, the kernel exposes IPv4 clients as ::ffff: addresses. Application logs end up with these mapped forms, which makes grep against expected IPv4 lists fail. Run them through this converter to normalize before comparing — or to confirm a tunnel is delivering 6to4 traffic correctly.

Frequently Asked Questions

What is an IPv4-mapped IPv6 address?
It lives in ::ffff:0:0/96 (RFC 4291). Dual-stack sockets expose IPv4 clients as mapped addresses so a single bind handles both protocols.
Why are there two zero-prefix formats?
::a.b.c.d is the IPv4-compatible form, deprecated by RFC 4291. ::ffff:a.b.c.d is the IPv4-mapped form, current. We emit both because old systems still produce the compatible form.
Is ::ffff:a.b.c.d deprecated?
No — IPv4-mapped is the recommended way to represent IPv4 endpoints in dual-stack code today. The deprecated form is the IPv4-compatible variant (without ffff).
Can I extract IPv4 from any IPv6?
Only when the IPv6 is in the mapped or compatible range. For a regular IPv6 like 2001:db8::1, there is no IPv4 component to extract — the tool will show only the expanded and compressed forms.
What is the difference between :: and 0:0:0:0:0:0:0:0?
0:0:0:0:0:0:0:0 is the explicit unspecified address. :: is the same address in compressed form. The compressed form is the canonical representation in IPv6.
Does my IP leave the page?
No. The conversion runs in JavaScript inside this tab. We do not see, log, or store the address you typed.