IPv4/IPv6 Converter
Convert IPv4 to IPv4-mapped, IPv4-compatible and 6to4 IPv6, and normalise IPv6 notation.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
IPv4 192.0.2.1 → ::ffff:192.0.2.1.
How it works
- Parsed the 32-bit IPv4 address.
- Prepended the 0xffff marker for the IPv4-mapped form and the all-zero prefix for the compatible form.
- Placed the address in the 6to4 prefix 2002::/16.
- IPv4-compatible addresses are deprecated but still recognised.
- A general IPv6 address is never coerced into an IPv4 address.
Methodology
- Detect the address family with strict parsers (dotted-quad first, then IPv6).
- For IPv4, place the 32-bit value in the mapped, compatible and 6to4 prefixes.
- For IPv6, split into eight groups, compress the longest zero run, expand, and serialise the 128-bit value as a big integer.
- Refuse to coerce a general IPv6 address into IPv4.
Usage
- Choose a conversion mode (or leave it on Auto).
- Enter an IPv4 or IPv6 address.
- Read or copy the converted forms.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
IPv4 to its IPv6 forms
{
"address": "192.0.2.1",
"mode": "ipv4-to-ipv6"
}Normalise a compressed IPv6
{
"address": "2001:db8::1",
"mode": "ipv6-normalize"
}Recover IPv4 from an IPv4-mapped address
{
"address": "::ffff:192.0.2.1",
"mode": "ipv6-to-ipv4"
}Limitations
Three ways to embed IPv4
IPv6 has several address forms that carry an IPv4 address in their low 32 bits. The IPv4-mapped form (::ffff:0:0/96) represents an IPv4 node on a dual-stack host, 6to4 (2002::/16) encodes an IPv4 address as the tunnel endpoint, and the deprecated IPv4-compatible form (::/96) was an early transition mechanism.
Text compression is separate from the address itself: :: may replace the longest run of zero groups once, and the converter always round-trips the address through its 128-bit integer value so the notation and the value never disagree.
Frequently asked questions
- What is an IPv4-mapped IPv6 address?
- It has the form ::ffff:a.b.c.d and is used on dual-stack hosts to represent an IPv4 node with an IPv6 address. The tool converts it back to dotted IPv4 exactly.
- Does every IPv6 address contain an IPv4 address?
- No. Only mapped, compatible and 6to4 addresses embed an IPv4 address; the converter says so rather than inventing one.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.