IPv6 to IPv4 Converter Guide | Map Addresses Online

All posts

Learn when IPv6-to-IPv4 mapping is needed for legacy systems and how to convert or map addresses with a free online tool.

IPv6 to IPv4 mapping guide: extract IPv4 from mapped and embedded IPv6 addresses

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.

128-bit

IPv6 Address Space

32-bit

IPv4 Address Space

::ffff

IPv4-Mapped Prefix

RFC 6052

NAT64 Embedding

Key facts: IPv6 to IPv4 mapping (quick reference)

Use this section for fast answers in search results and AI summaries:

Why teams search for "convert IPv6 to IPv4"

IPv6 deployment is widespread, but IPv4-shaped data still appears in day-to-day engineering work:

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.

Flowchart: IPv4-mapped IPv6 and NAT64 embedded addresses can yield an IPv4 value; native IPv6 cannot be universally converted

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:

Worked example (matches our converter)

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:

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:

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.

  1. Copy the IPv6 string from your log line, SQL row, or API payload.
  2. Paste it into the IPv6 Address field (sample placeholder: ::ffff:0c35:1704).
  3. 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.
  4. 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

  1. From an IPv6-only test host, resolve the target hostname and capture the AAAA answer.
  2. Confirm the prefix matches your DNS64 configuration (well-known 64:ff9b::/96 or your NSP).
  3. Extract the embedded IPv4 and compare it to the IPv4 A record from an IPv4 resolver or dig A on a dual-stack machine.
  4. Trace UDP/TCP through the NAT64 gateway if translation fails (state timeouts, ACLs, or MTU issues are common).

Common mistakes

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

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.

Browse all posts