IPv4 to IPv6 Converter
Turn an IPv4 address into its IPv6 forms (IPv4-mapped, 6to4 and NAT64), or paste an IPv6 address to expand it, compress it the RFC 5952 way and pull out any IPv4 address it carries.
How to Use
- Type an IPv4 address (
8.8.8.8, or as a number such as134744072or0x08080808) or an IPv6 address (2001:db8::1). The page works out which one it is. - For IPv4 you get the IPv4-mapped address, the 6to4 /48 prefix and the NAT64 address in the readouts, and every other form in the table: integer, hex, binary, reverse-DNS name and the deprecated forms.
- For IPv6 you get the RFC 5952 compressed text, the fully expanded form and any IPv4 address inside it: IPv4-mapped, 6to4, Teredo (server, client and port) or NAT64.
- If your network uses its own NAT64 prefix, type it in the NAT64 prefix box (for example
2001:db8:122:344::/64). RFC 6052 allows lengths 32, 40, 48, 56, 64 and 96. - The diagram shows where the IPv4 bits sit inside the 128 bits. Click any value to copy it, and read Show Work for each step.
Worked Example
8.8.8.8 to IPv6. Each octet is 8 = 0x08, so the 32 bits are 0x08080808, two 16-bit groups 0808 and 0808, written 808:808. The IPv4-mapped address puts 80 zero bits and ffff in front: ::ffff:808:808, which RFC 5952 recommends writing as ::ffff:8.8.8.8. 6to4 puts 2002 in front instead and gives the site a /48: 2002:808:808::/48. NAT64 puts the IPv4 address after the 96-bit well-known prefix: 64:ff9b::8.8.8.8.
A Teredo address taken apart. 2001:0:cb00:7101:8000:63bf:39cc:9bf8 starts with the Teredo prefix 2001:0::/32. The next 32 bits, cb00:7101, are the server, 203.0.113.1. Flags 8000 means the cone bit is set. The port 63bf XOR ffff = 9c40 = 40000, and the last 32 bits 39cc:9bf8 XOR ffff:ffff = c633:6407 = 198.51.100.7, the client’s public address. RFC 4380 inverts them so that NAT boxes do not rewrite them.
The common mistake: :: for one zero group. RFC 6052’s own Table 1 prints 192.0.2.33 under the /64 prefix 2001:db8:122:344::/64 as 2001:db8:122:344:c0:2:2100::, but only the last group is zero there, and RFC 5952 § 4.2.2 says “::” must not shorten a single 16-bit 0 field. The canonical text is 2001:db8:122:344:c0:2:2100:0, and that is what this converter prints. Both strings mean the same 128 bits.
Show Work
Formulas and Formats
How IPv4 and IPv6 Were Made to Coexist
Running out of IPv4. IPv6 was first specified in RFC 1883 in December 1995 and became a full Internet Standard as RFC 8200 in July 2017. In between, the free pool of IPv4 ran dry: the IANA IPv4 Address Space registry shows the last five unallocated /8 blocks, 102, 103, 104, 179 and 185, handed to the five regional registries in February 2011.
Tunnels first. The early plan was to carry IPv6 inside IPv4. 6to4 (RFC 3056, February 2001) gave every public IPv4 address a /48 under 2002::/16, and Teredo (RFC 4380, February 2006) reached hosts behind NAT through UDP, using 2001:0::/32. Both still appear in the IANA IPv6 Special-Purpose Address Registry, but RFC 7526 (May 2015) found that 6to4 used in its anycast mode had “severe practical problems”, deprecated the relay prefix 192.88.99.0/24 and moved RFC 3068 to Historic. RFC 4291 (February 2006) also deprecated the IPv4-compatible format, because “the current IPv6 transition mechanisms no longer use these addresses”.
Translation and dual stack. RFC 6052 (October 2010) fixed how an IPv4 address is written inside an IPv6 prefix, with the well-known prefix 64:ff9b::/96 and network-specific prefixes from /32 to /96; NAT64 (RFC 6146) and DNS64 (RFC 6147) followed in April 2011, and RFC 8215 (August 2017) added 64:ff9b:1::/48 for local use. The IPv4-mapped format, ::ffff:0:0/96, is how dual-stack software shows an IPv4 peer on an IPv6 socket. RFC 5952 (August 2010) settled how all of these are written as text.
About This Converter
Reference: Internet Protocol History.
This converter reads an IPv4 address in dotted, integer or hex form, or an IPv6 address in any valid text form (with or without brackets, a zone index or a prefix length), and shows every standard way the two families meet: IPv4-mapped, 6to4, NAT64 with the well-known or your own prefix, the deprecated IPv4-compatible and historic IPv4-translated forms, Teredo, integer, hex, binary and reverse-DNS names. Address types come from the IANA IPv4 and IPv6 Special-Purpose Address Registries; it warns when an address is private, because RFC 6052 forbids the NAT64 well-known prefix for it and 6to4 needs a public IPv4 address.
The 128-bit arithmetic uses JavaScript BigInt, so nothing is rounded. Everything runs in your browser and no address you type is sent anywhere. It is for network and system administrators, developers reading dual-stack logs, and students learning IPv6. For the background, read IPv4 vs IPv6.
Related tools: IP Subnet Calculator & CIDR Visualizer, IP Lookup, and DNS Lookup.
Frequently Asked Questions
How do I convert an IPv4 address to IPv6?
There is no single IPv6 version of an IPv4 address; it depends on the job. Software that handles both protocols on one socket uses the IPv4-mapped form, ::ffff: followed by the address: 8.8.8.8 becomes ::ffff:8.8.8.8, or ::ffff:808:808 in hex (RFC 4291). An IPv6-only network reaching IPv4 through NAT64 uses 64:ff9b::8.8.8.8 (RFC 6052). The old 6to4 tunnel scheme gave a site 2002:808:808::/48 (RFC 3056).
Which of these forms are deprecated?
The IPv4-compatible form, ::8.8.8.8, is deprecated by RFC 4291 (2006) because no transition mechanism uses it any more. The IPv4-translated form, ::ffff:0:8.8.8.8, came from RFC 2765, which RFC 6145 and later RFC 7915 replaced. For 6to4, RFC 7526 (2015) deprecated the anycast relay prefix 192.88.99.0/24 and moved RFC 3068 to Historic; plain 6to4 (RFC 3056) is still defined. IPv4-mapped and NAT64 are current.
How is an IPv6 address shortened?
RFC 5952 (2010) gives one canonical text form: drop leading zeros in each group, replace the longest run of two or more all-zero groups with :: (the first run if two are equally long), never use :: for a single zero group, and write hex in lower case. 2001:0DB8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1, and 2001:db8:0:0:1:0:0:1 becomes 2001:db8::1:0:0:1. For IPv4-mapped addresses it recommends a dotted ending, ::ffff:192.0.2.1.
Can every IPv6 address be converted back to IPv4?
No. IPv6 has 2128 addresses and IPv4 has 232, so only addresses built around an IPv4 address carry one: IPv4-mapped, the old compatible and translated forms, 6to4 (bits 16–47), Teredo (the client address, bit-inverted, in the last 32 bits) and NAT64 prefixes. A native address such as Google’s 2001:4860:4860::8888 has no IPv4 inside, even though the same service also answers on 8.8.8.8.
How do NAT64 and DNS64 use 64:ff9b::/96?
An IPv6-only device asks DNS64 (RFC 6147, 2011) for a name that only has an IPv4 address; DNS64 builds an IPv6 answer by putting the IPv4 address after a NAT64 prefix, and the NAT64 gateway (RFC 6146) translates the packets. The well-known prefix is 64:ff9b::/96, so 192.0.2.33 becomes 64:ff9b::192.0.2.33, or 64:ff9b::c000:221. RFC 6052 forbids the well-known prefix for private addresses such as 10.0.0.0/8, so operators with private IPv4 use their own prefix.
How do I use the IPv4 to IPv6 Converter?
Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
Reading server logs
A dual-stack server logs an IPv4 client as ::ffff:203.0.113.5; this shows it is the IPv4 address 203.0.113.5.
NAT64 and DNS64 networks
On an IPv6-only network, 1.1.1.1 is reached as 64:ff9b::1.1.1.1, which is 64:ff9b::101:101 in hex.
Firewall and ACL rules
Normalise 2001:0DB8:0000:0000:0000:0000:0000:0001 to the RFC 5952 form 2001:db8::1 so the same host matches every rule.
Reverse DNS zones
8.8.8.8 has the PTR name 8.8.8.8.in-addr.arpa; an IPv6 address needs all 32 nibbles reversed under ip6.arpa.
Tracing old tunnels
2002:c000:201::1 is a 6to4 address of the site 192.0.2.1, and a 2001:0::/32 Teredo address hides the client’s public IPv4 and port.
Network exams and labs
See the 80 zero bits, the ffff and the 32 IPv4 bits of ::ffff:8.8.8.8 drawn to scale across all 128 bits.
Last updated: