How to use
- Enter an IPv4 address such as
192.0.2.1and a table shows four IPv6 notations: IPv4-mapped, IPv4-compatible, 6to4 and NAT64. Each address has its own copy button. - Enter an IPv6 address instead to see the compressed form (RFC 5952), the expanded form, the mixed IPv4 notation, the
ip6.arpareverse name and the address type. If an IPv4 address is embedded, it is pulled out for you. - To use a NAT64 prefix other than the well-known one, edit the NAT64 prefix field. Only lengths 32, 40, 48, 56, 64 and 96 are valid.
The conversions
Results for 192.0.2.1:
| Type | Result | Used for |
|---|---|---|
| IPv4-mapped | ::ffff:c000:201 (mixed ::ffff:192.0.2.1) |
an IPv6 socket representing an IPv4 connection |
| IPv4-compatible | ::c000:201 |
deprecated by RFC 4291, do not use in new setups |
| 6to4 | 2002:c000:201::/48 |
old tunnel scheme giving each IPv4 address a /48 |
| NAT64 | 64:ff9b::c000:201 |
IPv6-only networks reaching IPv4 servers |
You rarely type mapped addresses yourself, but you see them in server logs: a dual-stack server records an IPv4 client as ::ffff:203.0.113.5. When you put such a client in a firewall or allow list, use the dotted IPv4 form instead.
NAT64 layout by prefix length (RFC 6052)
With a /96 prefix the IPv4 address sits unchanged in the last 32 bits. With shorter prefixes bits 64 to 71 (the u octet) must stay zero, so the IPv4 address is split in two parts. Embedding 192.0.2.33 gives:
| Prefix length | Result |
|---|---|
| /32 (2001:db8::/32) | 2001:db8:c000:221:: |
| /40 | 2001:db8:1c0:2:21:: |
| /48 | 2001:db8:122:c000:2:2100:: |
| /56 | 2001:db8:122:3c0:0:221:: |
| /64 | 2001:db8:122:344:c0:2:2100:: |
| /96 | 2001:db8:122:344::192.0.2.33 |
The longer-than-32 rows use the prefix 2001:db8:122:344:: cut to that length. Enter an IPv6 address and the same prefix to extract the IPv4 address in reverse; the well-known 64:ff9b::/96 is always checked, so 64:ff9b::808:808 yields 8.8.8.8.
IPv6 compression rules
Per RFC 5952 only the longest run of zero groups is replaced by ::, the first one wins a tie, and a single zero group is never shortened. Leading zeros are dropped and hex digits are lowercase. 2001:0db8:0000:0000:0001:0000:0000:0001 becomes 2001:db8::1:0:0:1.
Frequently asked questions
Will an IPv4 address written as IPv6 connect to the same server?
No. Only the notation changes; the server does not necessarily answer on that address. Mapped addresses are not routable, and 6to4 and NAT64 need a tunnel provider and a NAT64 gateway respectively.
What is an address starting with ::ffff: ?
An IPv4-mapped IPv6 address. The last 32 bits are the IPv4 address, also written in dotted form such as ::ffff:192.0.2.1. Paste it here and the embedded IPv4 is shown.
Is 6to4 still used?
Hardly. RFC 7526 deprecated the 6to4 relay anycast address, so it is effectively retired. Keep it in mind when reading old configuration.
What is the ip6.arpa name for?
It is the name of an IPv6 address’s PTR (reverse DNS) record: the address expanded to 32 hex digits, reversed and joined with dots.
For network-level math use the IP Subnet Calculator and the CIDR Calculator, and to see an address in binary try the Number Base Converter. Addresses you enter are processed in your browser and never sent to a server.