IPv4 to IPv6 Converter and Calculator
Something is asking for an IPv6 address and all you have is an IPv4 one. Type it in and the converter gives you the IPv4-mapped form, the one that works for every address and the one you need in most cases, ready to copy. If the address is public, you also get its NAT64 and 6to4 forms. If it is not, you get a short note saying why those cannot work instead of a number that looks right and is not.
It works as an IPv4 to IPv6 calculator rather than a lookup: the IPv6 form is worked out from the four numbers you type, in your browser, so it is instant, free and needs no signup.
How to Convert IPv4 to IPv6 With This Tool
- Type an IPv4 address in the usual dotted form, such as 8.8.8.8.
- Press Convert to IPv6.
- Copy the IPv4-mapped result at the top. It is shown three ways - with the IPv4 still readable (::ffff:8.8.8.8), as a short form (::ffff:808:808), and written out in full - and all three are the same address.
- If someone has asked you for NAT64 or 6to4 by name, they are listed underneath. Where your address cannot use one, you will see a note in its place.
IPv4-Mapped, NAT64 and 6to4: Which IPv6 Form You Need
Only the IPv4-mapped form works for every address. The other two depend on what kind of address you have, and on whether someone has asked for them.
IPv4-mapped IPv6 address
This is ::ffff: followed by your IPv4 address. 8.8.8.8 becomes ::ffff:8.8.8.8, or ::ffff:808:808 with the address written in hex. A server that listens for IPv6 connections records IPv4 visitors this way, so it's the form you'll see in access logs, and it's valid IPv6 for any field that won't take anything else. Every IPv4 address has one, including private ones like 192.168.0.1.
NAT64
This is 64:ff9b:: followed by your IPv4 address. On a network that only has IPv6, a NAT64 gateway uses it to reach servers that only have IPv4, so 8.8.8.8 becomes 64:ff9b::808:808. It only works with an address that is reachable from the internet. Some networks use a prefix of their own instead of 64:ff9b::; the network's administrator or the gateway's settings will tell you which.
6to4
This is 2002: followed by your IPv4 address in hex, so 8.8.8.8 becomes 2002:808:808::. It's an old way of carrying IPv6 across IPv4 links that modern systems switch off by default, and the converter marks it as such. You'll mostly need it to make sense of settings someone else configured years ago. Like NAT64, it only works with a public address.
How to Convert IPv4 to IPv6 by Hand
The arithmetic takes a minute. Here it is for 203.0.113.10.
- Turn each of the four numbers into two hex digits. Divide by 16: the result is the first digit and the remainder is the second, with 10 to 15 written as a to f. 203 divided by 16 is 12 remainder 11, which gives cb.
- Pad any single digit with a leading zero, so 10 becomes 0a.
- Join the four pairs into two groups of four: cb00 and 710a.
- Put ::ffff: in front: ::ffff:cb00:710a. That's the IPv4-mapped address. Writing ::ffff:203.0.113.10 means exactly the same thing.
| Number | Divided by 16 | Hex |
|---|---|---|
| 203 | 12 remainder 11 | cb |
| 0 | 0 remainder 0 | 00 |
| 113 | 7 remainder 1 | 71 |
| 10 | 0 remainder 10 | 0a |
In the short form, zeros at the start of a group are left out, so 192.0.2.1 gives c000:0201, written ::ffff:c000:201.
For a public address, the same two groups go after 64:ff9b:: for NAT64 or after 2002: for 6to4. 8.8.8.8 gives 0808:0808, so its NAT64 address is 64:ff9b::808:808 and its 6to4 address is 2002:808:808::. The converter does this sum for you and checks whether each form can work for your address.
Why Some Addresses Have No NAT64 or 6to4 Form
NAT64 and 6to4 both send traffic to a real address on the internet. An address that only exists inside one building, or that was never meant to reach anyone, can't be used that way, so the converter shows a note in place of a result.
That covers the addresses a home or office router hands out (10.x.x.x, 172.16.x.x to 172.31.x.x, 192.168.x.x), the address a computer uses to talk to itself (127.x.x.x), addresses a device gives itself when nothing else is available (169.254.x.x), the shared pool some internet providers put customers behind (100.64.x.x to 100.127.x.x), multicast and broadcast addresses, 0.0.0.0, reserved ranges, and the example ranges set aside for documentation (192.0.2.x, 198.51.100.x, 203.0.113.x). The IPv4-mapped form still works for every one of them.
When You Need an IPv4 Address in IPv6 Form
A setting that only accepts IPv6
Some allowlists, configuration fields and APIs take an IPv6 address and nothing else, even when the machine you need to add only has IPv4. Paste the IPv4-mapped form: it is valid IPv6 and carries the same address.
Searching your logs for an IPv4 visitor
A server that listens on IPv6 often records IPv4 visitors as ::ffff:198.51.100.7. If you are searching logs or writing a filter for 198.51.100.7, convert it first so you know which spelling to look for. Rules written for one spelling quietly miss the other.
Holding the IPv6 spelling and wanting the IPv4 back out? That is the other direction - the IPv6 to IPv4 Converter reads it off for you, and handles 6to4, NAT64 and Teredo addresses too.
Reaching an IPv4 server from an IPv6-only network
On a network with only IPv6, an IPv4-only server is reached through a NAT64 gateway. Build the 64:ff9b:: address for the server’s public IPv4 to test that path by address, without waiting on DNS.
Test data for code that handles both
If your code stores, compares or validates addresses, it needs examples of one address in each spelling. The converter gives you the readable, short and full forms in one step, ready to drop into test cases.
Making sense of old 6to4 settings
Addresses starting 2002: still turn up on older routers and in configs nobody has revisited. Convert the public IPv4 you suspect is behind one and compare the two groups after 2002:. If they match, you have found where it came from.