IPv6 to IPv4 Converter
Paste an IPv6 address to get the IPv4 address inside it, see where its 32 bits sit and which format put them there. Most IPv6 addresses carry no IPv4 at all, and the converter says so.
Read as IPv6
Any IPv6 spelling, with brackets, a port, a %zone or a /prefix. Converted in your browser; nothing is sent.
203.0.113.5
Seen in a server log? This visitor came over IPv4, from 203.0.113.5: a dual-stack server writes IPv4 clients this way.
- IPv4
- Compressed (RFC 5952)
- Expanded (full)
- IPv4 as a number
- Decimal · hex · binary
- Reverse DNS name
How do I convert IPv6 to IPv4?
You can convert an IPv6 address to IPv4 only when an IPv4 address is already written inside it: find the format from the address's first bits, take the 32 bits that format reserves, and read them as four decimal numbers.
The converter does all three steps. In ::ffff:203.0.113.5 the first 96 bits are the IPv4-mapped prefix ::ffff:0:0/96 (RFC 4291), so the last 32 bits are the IPv4 address: cb00:7105 in hex, which is cb = 203, 00 = 0, 71 = 113 and 05 = 5.
Other formats put the 32 bits elsewhere: 6to4 right after 2002:, a network's NAT64 prefix around a skipped octet, Teredo inverted at the end. The ribbon in the tool shows where they sit in each address you type.
::ffff:0:0/96 IPv4-mapped prefixcb00:7105cb20300071113055203.0.113.5
One field, any spellingBrackets, ports, zones, prefixes, URLs and reverse names are read; the line under the field says how.The prefixThe first bits name the format, here Teredo's 2001::/32 from RFC 4380.Inverted bits, flipped backTeredo stores the client's port and IPv4 inverted; the row under them is the real value.The IPv4 addressEach lit byte in decimal, and the whole address under its bracket.The verdictIPv4 inside, the format, its status today, and what it means for you.Every form, ready to copyThe server, port, flags, the canonical IPv6 text, the full form and the reverse DNS name.Does every IPv6 address contain an IPv4 address?
No. An ordinary IPv6 address holds no IPv4 address at all; only a handful of formats embed one, and each announces itself with a known prefix or interface ID.
RFC 4291 tells software not to read structure into an IPv6 address beyond what its prefix defines, so a tool that turns 2001:db8:85a3::8a2e:370:7334 into an IPv4 address is inventing one. The formats that carry an IPv4 address are drawn here with where their 32 bits sit.
Only two are common today: IPv4-mapped addresses inside software, and NAT64 addresses on IPv6-only networks. 6to4 and Teredo have practically vanished from real traffic.
Why do my logs show ::ffff: addresses?
Because your server listens on one IPv6 socket for both protocols, and the operating system shows IPv4 visitors to it as IPv4-mapped addresses: ::ffff:203.0.113.5 is the IPv4 visitor 203.0.113.5, not an IPv6 one.
This is the dual-stack socket of RFC 3493. The mapped form exists only inside software: IANA marks ::ffff:0:0/96 as not forwardable and not globally reachable, so no packet on the internet carries it.
To report or block that visitor, use the plain IPv4 address. Tools disagree on how they print it: Go's older net package shows 203.0.113.5, while net/netip and Python 3.13 show ::ffff:203.0.113.5, so one visitor can appear both ways.
203.0.113.5IPv42001:db8::7IPv6[::]:443one IPv6 socket::ffff:203.0.113.5 - - [24/Oct/2026:09:14:02 +0000] "GET / HTTP/1.1" 200 2001:db8::7 - - [24/Oct/2026:09:14:05 +0000] "GET / HTTP/2" 200
How does NAT64 put an IPv4 address inside IPv6?
A NAT64 network gives every IPv4 host an IPv6 address by writing its IPv4 address into a prefix, 64:ff9b::/96 by default, so 192.0.2.33 becomes 64:ff9b::c000:221.
On an IPv6-only network, DNS64 answers a name that has only an A record with a made-up AAAA record built this way, and the translator turns packets to that address into IPv4. Devices find their network's prefix by asking for ipv4only.arpa.
A network can use its own prefix of 32, 40, 48, 56, 64 or 96 bits (RFC 6052). Bits 64–71 then stay zero, so with /40, /48 and /56 the IPv4 address is split around that octet. The address alone doesn't say which length a network chose, which is why the tool asks. The well-known prefix must never carry a private IPv4 address.
2001:db8:c000:221::2001:db8:1c0:2:21::2001:db8:122:c000:2:2100::2001:db8:122:3c0:0:221::2001:db8:122:344:c0:2:2100:02001:db8:122:344::192.0.2.3364:ff9b::192.0.2.33What is a Teredo address?
A Teredo address is an IPv6 address for a computer behind IPv4 NAT, tunnelled over UDP; it holds the Teredo server's IPv4 address and, inverted, the client's public IPv4 address and port.
It has five parts: the prefix 2001::/32, the server's IPv4 address in bits 32–63, 16 flag bits, the UDP port the client's NAT assigned, and the client's public IPv4 address, the last two with every bit inverted (RFC 4380).
Since RFC 5991, 12 of the 16 flag bits are random, so flags other than 0x8000 are normal. Teredo is practically gone from today's internet, but old logs and firewall rules still hold its addresses.
2001:0000·2001:00002001::/32c000:0201·c000:0201192.0.2.18000·80000x800063bfXOR ffff ↓9c404000034ff:8efaXOR ffff:ffff ↓cb00:7105203.0.113.5What are 6to4 and ISATAP addresses?
6to4 and ISATAP were early ways to carry IPv6 over IPv4 networks, and both write an IPv4 address into the IPv6 address: 6to4 right after 2002:, ISATAP in the interface ID after 5efe.
A 6to4 site's prefix is 2002: followed by its public IPv4 address, so 192.0.2.33 owned 2002:c000:221::/48. RFC 7526 retired the anycast relays that made 6to4 work across the internet, not the format.
ISATAP builds the last 64 bits from 0:5efe, or 200:5efe for a public IPv4 address, followed by the IPv4 address, under any /64 prefix.
Share of Google's IPv6 users arriving through 6to4 or Teredo
How do I get my IPv4 address from IPv6?
Look it up on its own: your IPv4 and IPv6 addresses are two independent addresses, your IPv6 address doesn't contain the IPv4 one, and What Is My IP shows both side by side.
A dual-stack connection has an IPv4 address, often shared through the provider's NAT, and an IPv6 prefix; each website reaches you over whichever one your browser picks. The converter helps only with addresses in the embedded formats, such as a mapped address in a log.
On an IPv6-only mobile network, your apps' IPv4 traffic goes through the provider's 464XLAT, and the IPv4 address websites see belongs to the provider's translator.
How do I force IPv4 instead of IPv6?
Make your computer prefer IPv4 rather than switch IPv6 off: computers try IPv6 first when a name has both kinds of address, and raising IPv4 in the address-selection table changes that while IPv6 keeps working.
Microsoft recommends exactly this on Windows and warns against disabling or unbinding IPv6, which can stop parts of Windows from working. On a Mac, System Settings has no off switch for IPv6. On Linux, one line in /etc/gai.conf does it, though Chrome sorts addresses itself.
For a single command, most tools take -4. The tabs show each system's steps, checked against the vendor's own documentation.
The address-selection table
| Default | Prefer IPv4 | |
|---|---|---|
| IPv6 (::/0) | 40 | 40 |
| IPv4 (::ffff:0:0/96) | 35 | 100 |
RFC 6724 §2.1, §10.3
Frequently asked questions
Can every IPv6 address be converted to IPv4?
What is the IPv4 address in ::ffff:192.0.2.1?
How do I convert a 64:ff9b:: address to IPv4?
Why does the converter ask for my network's NAT64 prefix length?
What is an IPv4-compatible IPv6 address?
How do I get the IPv4 address from an IPv6 address in Python?
Does converting an address change my connection?
How do I prefer IPv4 over IPv6 on Windows?
Why are 6to4 and Teredo addresses so rare now?
Is the address I paste sent to your server?
Missing something?Suggest a feature or a new tool
Related tools
IPv4 to IPv6
Every IPv6 form of an IPv4 address: mapped, NAT64 and 6to4, each marked in use or rare
IPv6 Compression
Shorten or expand IPv6 addresses the RFC 5952 way and see which rule removed each zero
IP to Decimal Converter
IP address to decimal, hex, binary and octal and back, with each octet's place values
What Is My IP
Your public IPv4 and IPv6 at once, with the network, location and a VPN check
IPv6 Test
Test if your IPv6 works, which family your browser picks and if a site has IPv6
Subnet Calculator
Network, broadcast, usable hosts and masks for any IPv4 or IPv6 block, plus VLSM, splits and cloud subnets
Reverse DNS Lookup
Find hostnames associated with any IP address via PTR records
DNS Lookup
Every DNS record from the domain's own nameservers, beside Google's and Cloudflare's cache