Searching for an IPv6 to IPv4 converter usually means one of two things: you have an IPv4-mapped IPv6 address from a dual-stack socket (for example ::ffff:192.0.2.1), or you are debugging NAT64 / DNS64 traffic where an IPv4 destination is encoded inside an IPv6 prefix (RFC 6052). You cannot turn a random native IPv6 address into a routable IPv4 peer on the public internet. There is no mathematical 1:1 map between the two protocols. This guide explains when mapping is valid, how embedded addresses are built, and how to extract the IPv4-shaped value with our free IPv6 to IPv4 Converter in your browser. Processing stays local; nothing is uploaded to a server.
IPv6 Address Space
IPv4 Address Space
IPv4-Mapped Prefix
NAT64 Embedding
Key facts: IPv6 to IPv4 mapping (quick reference)
Use this section for fast answers in search results and AI summaries:
- No universal conversion: A native IPv6 address (for example
2001:db8::1) does not have a single correct IPv4 equivalent on the global internet. - IPv4-mapped IPv6: Format
::ffff:a.b.c.d(or0000:0000:0000:0000:0000:ffff:a.b.c.d) embeds an IPv4 address for dual-stack APIs (RFC 4291). It is a programming convenience, not a wire format for cross-protocol routing. - NAT64 + DNS64: IPv6-only clients reach IPv4-only servers by resolving synthetic AAAA records and sending traffic to an IPv4-embedded IPv6 address; a stateful translator (RFC 6146) rewrites packets (RFC 6145).
- Well-known NAT64 prefix:
64:ff9b::/96is the IETF well-known prefix; many networks use a custom network-specific prefix (NSP) instead. - Legacy logs and apps: Payment gateways, fraud tools, and older analytics dashboards often expect dotted-decimal IPv4 even when your app logged
::ffff:x.x.x.xfromgetpeername()on a dual-stack socket. - Privacy: Our IPv6 to IPv4 Converter runs entirely in JavaScript in your tab. Paste addresses from logs without sending them to our backend.
Why teams search for "convert IPv6 to IPv4"
IPv6 deployment is widespread, but IPv4-shaped data still appears in day-to-day engineering work:
- Application logs: Node.js, Go, and Java servers on dual-stack hosts often record client IPs as IPv4-mapped IPv6 when the listener uses
AF_INET6. - Load balancers and CDNs: Health checks and access logs may show
::ffff:203.0.113.10while your WAF rule library only lists IPv4 CIDR blocks. - Database columns: Older schemas store
INETorVARBINARY(4)and reject full IPv6 literals until you normalize the value. - Third-party APIs: Some geolocation, rate limiting, and card-processing APIs still document IPv4-only fields even when your edge already speaks IPv6.
- Transition debugging: SREs validating NAT64 paths need to confirm that the last 32 bits of an embedded address match the IPv4 A record from DNS64.
The fix is never "convert the whole internet to IPv4." The fix is to recognize which IPv6 string you hold (mapped, embedded, or native) and extract or translate accordingly.
Figure 1: Three common paths when someone asks to convert IPv6 to IPv4.
IPv4-mapped IPv6 addresses (::ffff)
An IPv4-mapped IPv6 address stores a 32-bit IPv4 address in the low-order bits of a 128-bit IPv6 structure. The high 96 bits are all zero except for sixteen bits set to ffff, giving the familiar textual form:
::ffff:192.0.2.33
::ffff:c0a8:0001 # same as 192.168.0.1 in hex groups
0000:0000:0000:0000:0000:ffff:192.0.2.33
Important properties every developer should know:
- Socket API only: Mapped addresses help IPv6-only application code talk to IPv4 peers on a dual-stack host. They should not appear on the wire as a substitute for real IPv6 routing.
- Not reversible for routing: Writing
::ffff:1.2.3.4does not make an IPv4-only remote host reachable from an IPv6-only network without translators. - Detection: Libraries expose helpers such as
IN6_IS_ADDR_V4MAPPED()(POSIX) or parsing withinet_pton/inet_ntopafter normalization.
Worked example (matches our converter)
- Input:
::ffff:0c35:1704 - Expanded: last 32 bits
0c35:1704→ bytes0x0c,0x35,0x17,0x04 - Output IPv4:
12.53.23.4
NAT64, DNS64, and RFC 6052 embedding
When an IPv6-only laptop queries DNS for a hostname that only has an IPv4 A record, a DNS64 server (RFC 6147) can synthesize an AAAA record. The IPv6 address in that AAAA record embeds the IPv4 address inside a configured prefix using the algorithm in RFC 6052. A stateful NAT64 device (RFC 6146) then translates packets between the embedded IPv6 form and the real IPv4 destination.
Prefix length controls where the 32 IPv4 bits land inside the 128-bit IPv6 address. Common deployment options include /32, /40, /48, /56, /64, and /96 layouts. For the well-known /96 prefix 64:ff9b::/96, the IPv4 address often appears literally in the last 32 bits:
- IPv4 A record:
192.0.2.33 - Synthetic AAAA (conceptual):
64:ff9b::192.0.2.33
With a longer organizational prefix (for example 2001:db8:122:344::/96), the dotted IPv4 tail is still common, but always confirm the prefix your resolver and firewall document. Guessing the wrong prefix produces plausible-looking but wrong IPv4 values.
What you cannot convert (and why misleading tools fail)
Taking the last 32 bits of an arbitrary IPv6 address and calling it "the IPv4" is only valid when you already know the address was constructed that way (mapped, NAT64, or certain obsolete transition technologies like 6to4 or ISATAP in legacy networks). For a normal global unicast IPv6 address, those four bytes are just part of a larger identifier. They do not tell you which IPv4 host, if any, corresponds to that client.
Red flags that you are not looking at a simple mapped address:
- The address starts with
2001:,2600:,2a00:, or other provider aggregates with no translator prefix. - There is no
ffffword in the mapped position and no documented NAT64 prefix from your network team. - You expected a client's "real" IPv4 but the user is on IPv6-only mobile data with no IPv4 at all.
Address types compared
| Type | Example shape | Safe to extract IPv4? | Typical source |
|---|---|---|---|
| IPv4-mapped IPv6 | ::ffff:a.b.c.d |
Yes | Dual-stack sockets, some proxies |
| NAT64 embedded (RFC 6052) | 64:ff9b::a.b.c.d |
Yes, with correct prefix | DNS64 synthetic AAAA |
| IPv4-compatible (deprecated) | ::a.b.c.d |
Legacy only | Old transition docs (rare today) |
| Native global unicast | 2001:db8::1 |
No | Normal IPv6 endpoints |
Method 1: Use the free IPv6 to IPv4 Converter (easiest)
For mapped addresses and quick log cleanup, open the IPv6 to IPv4 Converter. It accepts standard compressed IPv6 text, expands :: notation, detects the ffff mapped form, and prints dotted-decimal IPv4 on the right with a one-click copy field.
- Copy the IPv6 string from your log line, SQL row, or API payload.
- Paste it into the IPv6 Address field (sample placeholder:
::ffff:0c35:1704). - Read the IPv4 Address output. If the input was not a mapped address, the tool still interprets the last 32 bits as four bytes: treat that as a hint only when you know your data source uses that encoding.
- Click Reset to clear both fields before the next address.
Need the opposite direction for socket tests? Use the IPv4 to IPv6 Converter to build mapped literals from dotted input.
Method 2: Command line and code
Linux and macOS
GNU getent and Python's ipaddress module are reliable for validation:
python3 -c "import ipaddress; print(ipaddress.IPv6Address('::ffff:192.0.2.1').ipv4_mapped)"
If ipv4_mapped is None, the address is not IPv4-mapped in the standard sense.
Node.js
import { isIPv4, isIPv6 } from 'node:net';
// Prefer parsing mapped forms explicitly before trusting last-octet hacks.
Normalize before comparing
Expand compression, lowercase hex, and strip zone IDs (%eth0) before deduplicating firewall rules. The IPv6 Expand and Compress tool helps when your SIEM stores fully expanded addresses but your app logs compressed forms.
Method 3: Operational checks on NAT64 paths
- From an IPv6-only test host, resolve the target hostname and capture the AAAA answer.
- Confirm the prefix matches your DNS64 configuration (well-known
64:ff9b::/96or your NSP). - Extract the embedded IPv4 and compare it to the IPv4 A record from an IPv4 resolver or
dig Aon a dual-stack machine. - Trace UDP/TCP through the NAT64 gateway if translation fails (state timeouts, ACLs, or MTU issues are common).
Common mistakes
- Storing mapped strings in an IPv4 column without stripping the
::ffff:prefix, then wondering whyINET_ATONfails. - Feeding native IPv6 into IPv4-only fraud rules and blocking legitimate users. Update the vendor integration or map only when the address type is known.
- Assuming DNS64 on corporate Wi-Fi when the client still has IPv4. RFC 6147 warns that dual-stack hosts should prefer real A records; synthetic AAAA is for IPv6-only paths.
- Mixing up IPv4-mapped and IPv4-compatible (
::1.2.3.4). Compatible addresses are deprecated; do not build new systems on them. - Using conversion output as geolocation truth without checking whether the address is embedded, proxied, or carrier-grade NAT on the IPv4 side.
Security and privacy notes
Client IP addresses are personal data in many jurisdictions. When you paste addresses into any online tool, prefer local processing (like our browser-based converter) for incident response notebooks. Mapped addresses reveal the same IPv4 you would have logged on a v4 socket, so apply the same retention and masking policies. For production pipelines, automate extraction in your log shipper rather than manual copy-paste.
Related tools on OnlineMiniTools
- IPv4 to IPv6 Converter: build
::ffffliterals from dotted input. - IPv6 Expand and Compress: canonicalize text before diffing or hashing.
- IPv6 to Binary Converter: inspect bit patterns for ACL debugging.
- IP Address Lookup: WHOIS and routing context after you normalize the IPv4.
Frequently Asked Questions
Can any IPv6 address be converted to IPv4?
No. Only special forms such as IPv4-mapped IPv6 (::ffff:x.x.x.x) or IPv4-embedded IPv6 used with NAT64/DNS64 (RFC 6052) contain a meaningful 32-bit IPv4 value. Native IPv6 addresses are not convertible to a single public IPv4 peer.
What is the difference between IPv4-mapped and NAT64 embedded addresses?
IPv4-mapped addresses (::ffff:...) are for dual-stack socket APIs on one host. NAT64 embedded addresses are synthesized by DNS64 so IPv6-only clients can reach IPv4 servers through a translator. Both can display an IPv4 tail, but they solve different problems.
Why does my Node.js app log ::ffff: addresses instead of dotted IPv4?
When a server listens on an IPv6 dual-stack socket, accepted IPv4 connections are often reported as IPv4-mapped IPv6 in sockaddr structures. Extract the mapped IPv4 before writing to legacy databases or APIs.
Is the OnlineMiniTools IPv6 to IPv4 converter free?
Yes. It runs in your browser with no sign-up. Paste an address, read the IPv4 output, and copy the result. Your input is not sent to our servers for conversion.
What prefix does NAT64 use?
Many networks use the well-known prefix 64:ff9b::/96 (RFC 6052). Enterprises often configure a custom network-specific prefix. Always use the prefix documented by your DNS64/NAT64 operator when decoding embedded IPv4.
When legacy dashboards, payment APIs, or firewall objects still expect dotted-decimal IPv4, start by classifying the IPv6 string you actually have. For mapped and embedded forms, extract the IPv4 with the IPv6 to IPv4 Converter, then continue with expand/compress or WHOIS tools as needed. For native IPv6 clients, fix the integration path (IPv6 support, proper logging, or controlled NAT64) instead of forcing a fake conversion.