IPv4 ↔︎ IPv6 (mapped)

Convert between IPv4 and IPv4-mapped IPv6 (::ffff:x.x.x.x).

About This Tool

The IPv4-Mapped IPv6 Converter translates between standard IPv4 addresses and their IPv4-mapped IPv6 equivalents (::ffff:x.x.x.x format). IPv4-mapped IPv6 addresses are used in dual-stack systems to represent IPv4 addresses within the IPv6 address space, enabling IPv6-only applications to communicate with IPv4 hosts. This mechanism is essential for IPv6 transition scenarios, socket programming with AF_INET6, and understanding how modern operating systems handle both IP versions simultaneously. The tool provides both compressed and expanded formats along with the dotted-quad notation variant.

How to Use

  1. To convert IPv4 to IPv6: Enter an IPv4 address (e.g., 192.0.2.1) and click the arrow button
  2. View the mapped IPv6 address in compressed format (::ffff:192.0.2.1)
  3. See the expanded format (0000:0000:0000:0000:0000:ffff:c000:0201)
  4. View the dotted format (::ffff:192.0.2.1) which uses IPv4 notation in the last 32 bits
  5. To convert back: Enter an IPv4-mapped IPv6 address in any format and click the arrow
  6. The tool accepts both ::ffff:192.0.2.1 and ::ffff:c000:0201 notations
  7. Error messages will appear if the IPv6 address is not a valid IPv4-mapped address

Features

  • Bidirectional conversion between IPv4 and IPv4-mapped IPv6
  • Shows compressed, expanded, and dotted-quad formats
  • Accepts multiple IPv6 input notations
  • Validates that IPv6 addresses are proper IPv4-mapped addresses
  • Displays all representation variants for learning
  • Real-time conversion with instant results
  • Clear error messages for invalid inputs
  • RFC 4291 compliant conversion

Common Use Cases

  • Understanding dual-stack networking and IPv6 transition mechanisms
  • Socket programming with AF_INET6 that accepts both IPv4 and IPv6
  • Configuring applications that use IPv6 sockets for IPv4 connections
  • Debugging network issues in dual-stack environments
  • Learning how operating systems represent IPv4 in IPv6 contexts
  • Working with libraries that use IPv4-mapped addresses internally
  • Analyzing packet captures from dual-stack systems
  • Configuring firewalls and access control lists in mixed environments
  • Understanding ::ffff:0:0/96 prefix behavior
  • Educational purposes for IPv6 transition learning

Technical Details

IPv4-mapped IPv6 addresses represent IPv4 addresses within the IPv6 address space using the special ::ffff:0:0/96 prefix. The last 32 bits contain the IPv4 address.

Format Structure:

  • Prefix: 80 bits of zeros (0000:0000:0000:0000:0000)
  • Mapping: 16 bits of ones (ffff)
  • IPv4 Address: Last 32 bits (the IPv4 address)

Example: 192.0.2.1 (0xC0.0x00.0x02.0x01)

  • Compressed: ::ffff:192.0.2.1 or ::ffff:c000:0201
  • Expanded: 0000:0000:0000:0000:0000:ffff:c000:0201
  • Binary: 96 zero bits + 16 one bits + 11000000 00000000 00000010 00000001

RFC 4291 Specification:

IPv4-mapped IPv6 addresses are defined in RFC 4291 section 2.5.5.2. They allow IPv6 applications to communicate with IPv4 hosts using IPv6 APIs:

  • Format: ::ffff:a.b.c.d where a.b.c.d is the IPv4 address
  • Prefix: ::ffff:0:0/96
  • Not routable on the Internet (used internally by systems)

Dual-Stack Socket Behavior:

When an application creates an IPv6 socket (AF_INET6) on a dual-stack system:

  • It can accept connections from both IPv4 and IPv6 clients
  • IPv4 connections appear as IPv4-mapped IPv6 addresses
  • Example: IPv4 client 192.0.2.1 appears as ::ffff:192.0.2.1 to the IPv6 socket
  • This allows a single socket to handle both protocols

Common Notations:

  • ::ffff:192.0.2.1 (dotted-quad notation, most readable)
  • ::ffff:c000:0201 (hexadecimal notation)
  • 0:0:0:0:0:ffff:192.0.2.1 (uncompressed with dotted-quad)

Important Notes:

  • IPv4-mapped addresses are different from IPv4-compatible addresses (::a.b.c.d, now deprecated)
  • They are not routable on the IPv6 Internet
  • Used for internal system representation only
  • Some systems can disable IPv4-mapped address support for security