How to Convert IPv4 to IPv6 (Mapped, 6to4, Examples)
Search “how to convert ipv4 to ipv6” and you are usually asking for a twin of 192.0.2.33 that you can paste into an AAAA record. That twin does not exist. An IPv4 host does not “get” an IPv6 address by converting it. You either represent the same 32 bits inside IPv6 (IPv4-mapped, the deprecated IPv4-compatible form, 6to4, or NAT64) or your ISP / LAN actually assigns a native prefix. FlashKit’s IPv4 to IPv6 converter does the mapped spelling in this tab. It does not allocate a prefix, does not open a tunnel, and does not look the address up.
How to convert IPv4 to IPv6: the short answer
IPv6 addresses are 128 bits. IPv4 addresses are 32 bits. There is no 1:1 mapping that produces a globally routable IPv6 address from a dotted quad. The standards that still show up in configs and logs are:
- IPv4-mapped (
::ffff:0:0/96, RFC 4291 §2.5.5.2) — how a dual-stack socket writes an IPv4 peer. - IPv4-compatible (
::/96, RFC 4291 §2.5.5.1) — deprecated; do not use it in new configs. - 6to4 (
2002::/16, RFC 3056) — automatic tunnel prefix from the IPv4 address. RFC 7526 (BCP 196) recommends against new 6to4 deployments. - NAT64 well-known prefix (
64:ff9b::/96, RFC 6052) — how a translator embeds IPv4 in IPv6.
A real IPv6 address on your laptop or server still comes from the ISP, from SLAAC/DHCPv6 on the LAN, or from a prefix you routed yourself. Conversion is notation, not assignment. The worked numbers below use RFC 5737 documentation space 192.0.2.0/24 (TEST-NET-1), not a live host.
Convert IPv4 to mapped IPv6 in this tab
Paste a dotted quad. The page prints ::ffff: plus two hex hextets. Local only — no WHOIS, no tunnel.
Open the IPv4 to IPv6 converterWorked example: 192.0.2.33 → ::ffff:c000:221
Start with 192.0.2.33. Write each octet in hex, two digits, no 0x prefix:
| Octet (decimal) | Hex | Why |
|---|---|---|
| 192 | c0 | 12×16 + 0 |
| 0 | 00 | pad to two digits |
| 2 | 02 | pad to two digits |
| 33 | 21 | 2×16 + 1 |
Pair the four bytes into two 16-bit hextets: c000 and 0221. Prefixed with the mapped well-known bits, the address is:
- Dotted inside IPv6:
::ffff:192.0.2.33(some stacks accept this mixed form). - Hex, zero-padded per octet (what FlashKit prints):
::ffff:c000:0221. - Compressed (Python
ipaddresson 192.0.2.33):::ffff:c000:221.
Those last two strings are the same 128-bit value. IPv6 text form is allowed to drop leading zeros in a hextet, so 0221 and 221 match. The converter pads each IPv4 octet to two hex digits and concatenates them, which is why the UI shows 0221. Paste 192.168.1.1 (the form default) and you get ::ffff:c0a8:0101 — 192=c0, 168=a8, 1=01, 1=01. Leading zeros in an octet are rejected: 192.168.01.1 is invalid on this page.
Notation table: mapped, compatible, 6to4, NAT64
Same IPv4 bits, four different embeddings. Only mapped is what the FlashKit converter prints.
| Form | Prefix | 192.0.2.33 becomes | Use today? |
|---|---|---|---|
| IPv4-mapped | ::ffff:0:0/96 |
::ffff:c000:221 |
Yes, in dual-stack APIs and logs |
| IPv4-compatible | ::/96 |
::c000:221 |
No — deprecated in RFC 4291 |
| 6to4 | 2002::/16 |
2002:c000:0221::/48 |
No for new deployments (RFC 7526) |
| NAT64 (WKP) | 64:ff9b::/96 |
64:ff9b::c000:221 |
Yes, on a NAT64 translator you operate |
6to4 takes the 32 IPv4 bits and sits them after 2002:, which is a /48 for that IPv4. NAT64 well-known prefix takes the same 32 bits after 64:ff9b::. Neither of those strings is what the FlashKit field prints. If a runbook says “convert to IPv6” and then pastes a 2002: address into DNS, that is a 6to4 plan, not mapped notation, and RFC 7526 is the document that says not to start that plan in 2026.
When you see ::ffff: in server logs
A dual-stack listening socket (IPv6 wildcard, IPv4 mapped in) will log IPv4 clients as ::ffff:c000:221 rather than 192.0.2.33. Access-control lists that only match dotted quads then miss the client. Normalise before you compare.
nginx map (real_ip / allow lists still want the IPv4 form):
map $remote_addr $addr4 {
~^::ffff:(.+)$ $1;
default $remote_addr;
}
Node (strip the mapped prefix, keep a native IPv6 address untouched):
function v4(addr) {
return addr.startsWith('::ffff:') ? addr.slice(7) : addr;
}
Python 3:
import ipaddress
a = ipaddress.ip_address('::ffff:c000:221')
print(a.ipv4_mapped) # 192.0.2.33
If ipv4_mapped is None, the address was native IPv6. Do not truncate the last 32 bits of a 2001:db8: address and call that “the IPv4” — there isn’t one. After you have a dotted quad, the IP address lookup is a GeoIP/WHOIS convenience check, not a conversion step.
A second documentation address from RFC 5737 TEST-NET-2: 198.51.100.14 → octets 198=c6, 51=33, 100=64, 14=0e → mapped ::ffff:c633:640e, 6to4 2002:c633:640e::/48, NAT64 64:ff9b::c633:640e. Use TEST-NET-1/2/3 in runbooks so you never paste a customer’s production IPv4 into a public gist. Private RFC 1918 addresses still map: the converter does not know or care that 192.168.1.1 is not globally routable. Mapped form of a private IPv4 is still private IPv4 wearing IPv6 clothes.
How to check whether you actually have IPv6
Notation on a whiteboard is not connectivity. On Linux, ip -6 addr lists addresses on each interface; a fe80:: link-local alone is not global IPv6. A globally routed address is usually 2000::/3 (currently 2001:, 2a00:, and similar allocations). On Windows, run ipconfig and look for “IPv6 Address” that is not “Link-local IPv6 Address.” On macOS, ifconfig and the inet6 lines; ignore fe80: unless you are debugging the LAN. On the ISP router, look for a delegated prefix (often /56 or /48) or a single /64 on the LAN. If the only IPv6 you see is ::ffff:… in an application log, you still have IPv4 on the wire. A browser test (a dual-stack test site you trust) confirms the path your ISP actually offers; a mapped address in nginx logs does not.
Serving IPv6 to the public Internet means an AAAA record at your DNS host pointing at a native address the host actually owns — not a mapped spelling of an A record. The converter will not create that AAAA for you.
Using the FlashKit converter and the CIDR calculator
The IPv4 to IPv6 converter is one field. It splits on dots, requires exactly four octets in 0–255 with no leading zeros, converts each octet with toString(16).padStart(2, '0'), and prints ::ffff:aabb:ccdd. That is mapped notation only. It does not offer a 6to4 or NAT64 toggle. Refreshing restores the sample 192.168.1.1.
When the question is “what range does this mask cover?” rather than “how do I spell this IPv4 in IPv6 syntax?”, open the IPv4 CIDR calculator — the matching how-to is the CIDR to IP range calculator guide. Despite the URL, that form is IPv4-only (prefix 0–32, network / broadcast / usable hosts). Prefix math for 2001:db8::/32 is not in that widget. For a dual-stack ACL, convert the IPv4 side to mapped form if the ACL language wants IPv6, and compute the v4 CIDR separately. A longer walkthrough of /24 and /26 sits in CIDR notation explained. Socket and DNS debugging more broadly is in network troubleshooting for web developers.
Check the prefix, not just the spelling
IPv4 network, mask, broadcast, usable hosts in this tab. IPv6 prefix math is not implemented there.
Open the CIDR calculatorFrequently asked questions
How to convert IPv4 to IPv6 — do I get a real IPv6 address?
No. Conversion writes the same 32 IPv4 bits inside an IPv6 spelling (mapped, deprecated compatible, 6to4, or NAT64). A native address still has to be assigned by your ISP, SLAAC, or DHCPv6.
What does ::ffff: mean in a server log?
It is an IPv4-mapped IPv6 address (RFC 4291). A dual-stack socket accepted an IPv4 client and presented it in IPv6 form. Strip ::ffff: (or decode the last 32 bits) to recover the IPv4 address.
Is a 6to4 address (2002:…) still usable?
RFC 3056 defined 6to4. RFC 7526 (BCP 196) recommends that it not be used for new deployments. Prefer native IPv6 or a maintained NAT64 translator.
Does FlashKit allocate a public IPv6 prefix?
No. The converter only prints IPv4-mapped notation (::ffff: plus two hex hextets). It does not tunnel packets, does not speak WHOIS, and does not request a prefix from an ISP.
Why does the tool print ::ffff:c000:0221 instead of ::ffff:c000:221?
Each IPv4 octet is padded to two hex digits, so 2 becomes 02 and the last hextet is 0221. That is the same 128-bit value as the compressed form ::ffff:c000:221.