Skip to content

IPv4 to IPv6 Converter

Four numbers from 0 to 255 separated by dots.

IPv4-mapped IPv6 address —
Mixed notation
—
Fully expanded
—
6to4 prefix
—
32-bit integer
—

An IPv4 address becomes IPv6 by placing it in the last 32 bits of ::ffff:0:0/96, the IPv4-mapped range from RFC 4291. Convert each octet to hex and pair them: 192.0.2.128 becomes c0 00 02 80, so the IPv6 form is ::ffff:c000:280, also written ::ffff:192.0.2.128.

About this tool

Firewall rules, dual-stack server logs and database columns that store every address as 128 bits all show IPv4 clients in their IPv6 disguise, and reading ::ffff:c0a8:101 back to 192.168.1.1 by eye is slow. This converter takes a dotted IPv4 address and returns the IPv4-mapped IPv6 address in compressed form, the mixed notation that keeps the dotted quad, the full 32-digit expansion and the 2002::/16 6to4 prefix that the address would own. A table shows every octet in decimal, hex and binary so you can check the working. One limit: there is no single IPv6 address that an IPv4 host automatically has; the mapped form is a representation used inside software and sockets, not an address you can ping across the internet.

How to use it

  1. Type the IPv4 address

    Enter a dotted quad such as 203.0.113.25; leading zeros in an octet are rejected.

  2. Read the mapped address

    The headline result is the compressed ::ffff: form, with the mixed and expanded versions underneath.

  3. Check the octet table

    Each octet is listed in decimal, two-digit hex and eight-bit binary.

  4. Use the 6to4 prefix if needed

    The 2002: prefix is the /48 network a 6to4 router on that public IPv4 address would announce.

Examples

Documentation address 192.0.2.128

IPv4 address
192.0.2.128

Result IPv4-mapped IPv6 address: ::ffff:c000:280
Mixed notation: ::ffff:192.0.2.128
Fully expanded: 0000:0000:0000:0000:0000:ffff:c000:0280
6to4 prefix: 2002:c000:280::/48
32-bit integer: 3,221,226,112

  1. Octets 192, 0, 2, 128 in hex: c0 00 02 80.
  2. Pair them into two 16-bit groups: c000 and 0280.
  3. Prefix with 80 zero bits and ffff (RFC 4291): 0000:0000:0000:0000:0000:ffff:c000:0280.
  4. Drop leading zeros and compress the zero run (RFC 5952): ::ffff:c000:280.

192.0 becomes c000 and 2.128 becomes 0280, so the mapped address is ::ffff:c000:280.

Public resolver 8.8.8.8

IPv4 address
8.8.8.8

Result IPv4-mapped IPv6 address: ::ffff:808:808
Mixed notation: ::ffff:8.8.8.8
Fully expanded: 0000:0000:0000:0000:0000:ffff:0808:0808
6to4 prefix: 2002:808:808::/48
32-bit integer: 134,744,072

  1. Octets 8, 8, 8, 8 in hex: 08 08 08 08.
  2. Pair them into two 16-bit groups: 0808 and 0808.
  3. Prefix with 80 zero bits and ffff (RFC 4291): 0000:0000:0000:0000:0000:ffff:0808:0808.
  4. Drop leading zeros and compress the zero run (RFC 5952): ::ffff:808:808.

Each 8 is 08 in hex, giving the groups 0808 and 0808, written without leading zeros.

Private address 10.0.0.1

IPv4 address
10.0.0.1

Result IPv4-mapped IPv6 address: ::ffff:a00:1
Mixed notation: ::ffff:10.0.0.1
Fully expanded: 0000:0000:0000:0000:0000:ffff:0a00:0001
6to4 prefix: 2002:a00:1::/48
32-bit integer: 167,772,161

  1. Octets 10, 0, 0, 1 in hex: 0a 00 00 01.
  2. Pair them into two 16-bit groups: 0a00 and 0001.
  3. Prefix with 80 zero bits and ffff (RFC 4291): 0000:0000:0000:0000:0000:ffff:0a00:0001.
  4. Drop leading zeros and compress the zero run (RFC 5952): ::ffff:a00:1.

The conversion still works, but the tool flags that a 6to4 prefix built from a private address is not routable.

How it is calculated

mapped = ::ffff: + hex(a·256 + b) + : + hex(c·256 + d); 6to4 = 2002: + same two groups + ::/48

a, b, c, d
the four decimal octets of the IPv4 address a.b.c.d
ffff
the 16 one bits that mark an IPv4-mapped address in RFC 4291
2002
the 6to4 prefix assigned in RFC 3056

RFC 4291 section 2.5.5.2 builds the mapped address from 80 zero bits, 16 one bits and the 32-bit IPv4 address. The first two octets form one 16-bit group and the last two form another. Text output follows RFC 5952: lowercase hex, leading zeros in a group dropped, and the longest run of zero groups replaced with a double colon.

When not to use it

  • To find the real IPv6 address of a host, query its AAAA record instead; mapping does not reveal it.
  • For NAT64 networks, which use the 64:ff9b::/96 prefix rather than ::ffff:.

Common mistakes

  • Converting each octet to hex but forgetting the leading zero, so 2.128 becomes 280 instead of the correct group 0280 before compression.
  • Confusing the deprecated IPv4-compatible form ::c000:280 with the mapped form ::ffff:c000:280.
  • Expecting a 6to4 prefix built from a private address such as 192.168.x.x to work on the public internet.

Frequently asked questions

What does ::ffff: mean at the start of an IPv6 address?

It marks an IPv4-mapped IPv6 address. The 80 zero bits are compressed to the double colon, ffff is the 16-bit marker, and the remaining 32 bits hold the original IPv4 address. Dual-stack sockets use it to report IPv4 clients.

Is ::ffff:192.0.2.128 the same as ::ffff:c000:280?

Yes. RFC 4291 allows the last 32 bits to be written as a dotted quad, so both strings describe the identical 128-bit value. Logs and programming libraries differ in which one they print.

How do I convert the mapped address back to IPv4?

Take the last two hex groups, pad each to four digits and split into byte pairs. For c000:0280 the bytes are c0, 00, 02 and 80, which are 192, 0, 2 and 128 in decimal.

What is the 6to4 prefix used for?

RFC 3056 gave every public IPv4 address a /48 under 2002::/16 so sites could tunnel IPv6 over IPv4. The relay anycast address was deprecated in RFC 7526, so 6to4 is now mostly seen in old configurations.

Why does the tool reject 010.0.0.1?

Some parsers read a leading zero as octal, so 010 would mean 8 rather than 10. Rejecting it avoids converting an address that different systems interpret differently.

Does this give my computer an IPv6 address?

No. The mapped address exists only inside software. Your IPv6 address comes from your network through SLAAC or DHCPv6, and has no fixed relation to your IPv4 address.