IPv4 to IPv6 converter
An IPv4 address has several standard spellings inside IPv6, each belonging to a different transition mechanism. This shows all of them, with the expanded form for log comparison and a note on which are still current.
- IPv4-mapped
- ::ffff:192.0.2.1How a dual-stack socket reports an IPv4 peer. This is the form you will actually meet, usually in logs from a server listening on ::.
- 6to4(deprecated)
- 2002:c000:201::/48A /48 of IPv6 space derived from an IPv4 address, used by the 6to4 tunnelling scheme. Relays were widely withdrawn and RFC 7526 deprecates it.
- NAT64 well-known prefix
- 64:ff9b::192.0.2.1Lets an IPv6-only client reach an IPv4 host through a NAT64 gateway (RFC 6052). Only meaningful when such a gateway is in the path.
- IPv4-compatible(deprecated)
- ::192.0.2.1An early transition format, deprecated by RFC 4291. Listed because it still turns up in old configuration and is easy to confuse with the mapped form.
Mapped versus compatible
These two look almost identical and mean different things. ::ffff:192.0.2.1 is IPv4-mapped and is current: it represents an IPv4 host to IPv6 API surfaces. ::192.0.2.1 is IPv4-compatible, was intended for automatic tunnelling, and has been deprecated since RFC 4291.
The single difference is the ffff group. Parsers that accept both and treat them alike have a bug that shows up as an address matching a rule it should not.
The prefixes involved
| Prefix | Form | Status |
|---|---|---|
| ::ffff:0:0/96 | IPv4-mapped | Current — what dual-stack sockets report |
| 64:ff9b::/96 | NAT64 well-known | Current — requires a NAT64 gateway |
| 2002::/16 | 6to4 | Deprecated (RFC 7526) |
| ::/96 | IPv4-compatible | Deprecated (RFC 4291) |
Frequently asked
- Is this really a conversion?
- Not in the way the name suggests. IPv4 has 32 bits of address space and IPv6 has 128, so there is no general mapping between them and no sense in which a host 'has' an IPv6 address derived from its IPv4 one. What exist are embeddings — specific notations used by specific mechanisms. Reaching an IPv4 host over IPv6 requires a gateway that actually translates, not a different way of writing the address.
- Why do my logs show ::ffff:192.0.2.1?
- A socket bound to :: on a dual-stack system accepts IPv4 connections and reports the peer in IPv4-mapped form. It is the same client that would have shown as 192.0.2.1 on an IPv4-only listener. Code that compares addresses as strings needs to normalise this, or an allowlist entry for 192.0.2.1 will silently fail to match.
- Should I use 6to4?
- No. RFC 7526 deprecated it and the public relays it depended on were largely withdrawn, so addresses in 2002::/16 are mostly a source of black-holed traffic today. It is listed here because it still appears in old configuration and in address-parsing questions, not because it is worth deploying.
- What is 64:ff9b::/96?
- The well-known prefix for NAT64 (RFC 6052). An IPv6-only client sends to 64:ff9b:: followed by the IPv4 address, and a NAT64 gateway on the path translates the packet. Without such a gateway the address routes nowhere — it is only meaningful inside a network that runs one.
Doing this for thousands of addresses?
These calculators run in your browser and never send us your input. When you need geolocation, ASN and network data for addresses in bulk, the API answers in one call — no key required to try it.
curl https://api.ipaddresstoday.com/api/v1/8.8.8.8Other free tools
- Subnet calculatorNetwork and broadcast address, subnet mask, wildcard mask, usable host range and host count for any IPv4 block.
- CIDR to IP rangeConvert a CIDR block to its first and last address, or collapse an arbitrary address range into the smallest set of CIDR blocks.
- IP address converterConvert an IPv4 address between dotted-quad, decimal, hexadecimal, binary and octal.
- IPv6 expand & compressExpand an IPv6 address to its full 39-character form, or compress it to the canonical RFC 5952 short form.
- IP range generatorList every address in a CIDR block or a first–last range, ready to paste into a firewall rule or a script.
- Random IP generatorGenerate random IPv4 addresses for test fixtures and load tests — optionally inside a given block, and publicly routable only.
- IP in range checkerCheck whether an address falls inside a CIDR block or a first–last range, and see how two blocks relate to each other.
- Subnet mask cheat sheetEvery IPv4 prefix from /32 to /0 with its subnet mask, wildcard mask, host count and block size — plus a mask to prefix converter.
- Reverse DNS name generatorBuild the in-addr.arpa or ip6.arpa PTR name for any address, and list the reverse zones covering a whole block.
- IP list sorter & deduplicatorPaste a messy list of addresses from logs or a spreadsheet. Get them sorted numerically, deduplicated, with the junk separated out.
- Bulk IP lookupLook up country, city, ISP and ASN for a whole list of addresses at once, and export the result as CSV.