ForHosting KIT · Developer Utilities

IPv4-mapped IPv6 converter

Enter 192.0.2.1 and get every common way to write it inside IPv6: ::ffff:192.0.2.1 and ::ffff:c000:201 for the mapped form, ::192.0.2.1 and ::c000:201 for the older compatible one. Paste any of those and the plain IPv4 comes back too. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Address
192.0.2.1
You get
Kind
ipv4
Ipv4
192.0.2.1
Octets
192, 0, 2, 1
Ipv4 mapped
::ffff:192.0.2.1

Operators paste a dotted quad and want every common literal at once; reverse engineers receive ::ffff:c000:201 in a log and need the embedded IPv4 back without hand-counting hextets. This IPv4-mapped IPv6 converter accepts a plain IPv4 address or an IPv4-mapped or IPv4-compatible IPv6 literal, normalizes the four octets, and returns both mixed-dotted and pure-hex presentations for mapped and compatible forms plus the recovered IPv4 string.

IPv4-mapped and IPv4-compatible embeddings explained

RFC 4291 defines how an IPv4 address can appear inside an IPv6 address for transition and representation. The IPv4-mapped form uses the prefix zero through ninety-five set to zero except the last sixteen bits of that prefix, which are all ones: in other words the well-known prefix ::ffff:0:0/96. Writing the embedded host as a dotted quad after that prefix yields the familiar mixed literal ::ffff:192.0.2.1; writing the same thirty-two bits as two hexadecimal hextets yields ::ffff:c000:201.

Stacks that accept IPv4 clients on an IPv6 socket often surface peer addresses in exactly this mapped shape, so converting either direction is a daily dual-stack task. The older IPv4-compatible form used a pure zero ninety-six-bit prefix (::/96) with the IPv4 bits in the last thirty-two bits, written ::192.0.2.1 or ::c000:201. That compatible form is deprecated for new use on the wire, but it still appears in textbooks, legacy configuration samples, and exam questions that ask you to recognize both embeddings.

This converter always emits both families from any accepted input so you can compare them side by side without running two tools. It does not invent other transition mechanisms such as 6to4, Teredo, or NAT64 well-known prefixes; those embeddings use different fixed prefixes and are out of scope.

Where an IPv4-mapped IPv6 converter earns its keep

Network engineering courses and certification prep still ask candidates to write the mapped form of a given IPv4 address and to read the embedded IPv4 out of a ::ffff hextet pair. Auto-graders need a deterministic oracle that treats ::ffff:c000:201 and ::ffff:192.0.2.1 as the same host while rejecting a random global unicast such as 2001:db8::1. Migration runbooks that still mention deprecated compatible literals can generate both strings for the same host without maintaining a private script.

Failed validation does not consume balance.

Dual-stack socket and allow-list normalization

Convert IPv4-mapped peer addresses from IPv6 sockets into dotted IPv4 for comparison with legacy allow-lists and firewall rules.

Certification and classroom drills

Generate ::ffff and compatible literals from a dotted quad, or extract the embedded IPv4 from mixed and hex forms for exam answer keys.

Config and log tooling

Normalize mixed ::ffff:a.b.c.d and ::ffff:HHHH:HHHH spellings in dual-stack configs and access logs to one canonical IPv4 plus both embedding styles.

What is an IPv4-mapped IPv6 address?

It is an IPv6 address under the ::ffff:0:0/96 prefix whose last 32 bits hold an IPv4 address, written as ::ffff:a.b.c.d or ::ffff:HHHH:HHHH. Dual-stack stacks often represent IPv4 peers this way on IPv6 sockets.

What is an IPv4-compatible IPv6 address?

It is the older ::/96 embedding (::a.b.c.d or ::HHHH:HHHH). It is deprecated for new on-wire use but still appears in textbooks and legacy samples; this converter still emits it for reference.

Can I convert both directions?

Yes. Send a dotted IPv4 to get mapped and compatible forms, or send a mapped/compatible IPv6 literal to recover the embedded IPv4 and both presentation styles.

Which IPv6 addresses are rejected?

Any literal that is not IPv4-mapped or IPv4-compatible (for example 2001:db8::1), plus CIDR suffixes, brackets, zone ids, bad octets, and malformed hextets.

Why does my server log show ::ffff: in front of an IPv4 address?

Many systems accept IPv4 clients on an IPv6 connection and record the visitor in mapped form, such as ::ffff:192.0.2.1. Paste it here to get the plain 192.0.2.1 back and compare it with older allow-lists and firewall rules.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/dev/ipv4-mapped-ipv6

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/dev/ipv4-mapped-ipv6 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address":"192.0.2.1"}'
{
  "address": "192.0.2.1"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.ipv4_mapped_ipv6",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Dual-stack networks, socket libraries, and certification labs constantly need the two classic embeddings that put a thirty-two-bit IPv4 address inside a one-hundred-twenty-eight-bit IPv6 address: the IPv4-mapped form with a double-colon ffff prefix, and the historical IPv4-compatible form with a pure double-colon ninety-six-bit zero prefix.

IPv4-mapped and IPv4-compatible embeddings explained

If you pass a pure global unicast IPv6 address that is neither mapped nor compatible, the task fails with invalid_input rather than guessing an unrelated IPv4.

Input contract, response fields, and validation errors

IPv6 input may use compressed double-colon notation or a fully expanded eight-hextet form, and the trailing thirty-two bits may be written as a dotted quad or as two hexadecimal hextets. Examples of accepted IPv6 shapes include ::ffff:10.0.0.1, ::ffff:a00:1, 0:0:0:0:0:ffff:c000:201, ::192.0.2.1, and ::c000:201. CIDR suffixes, square brackets, and zone identifiers are rejected. POST a JSON body with one required string field named address: either a dotted-decimal IPv4 address with exactly four octets from zero through two hundred fifty-five and no leading zeros, or an IPv4-mapped or IPv4-compatible IPv6 literal. Aliases ip, ipv4, and ipv6 are accepted with the same meaning. On success the body echoes the original address string, sets kind to ipv4, ipv4_mapped, or ipv4_compatible according to what you submitted, returns ipv4 as the normalized dotted quad and octets as a four-integer array, and always includes ipv4_mapped and ipv4_mapped_hex plus ipv4_compatible and ipv4_compatible_hex so clients can pick mixed or pure-hex style without a second call. Example: address 192.0.2.1 yields kind ipv4, ipv4_mapped ::ffff:192.0.2.1, ipv4_mapped_hex ::ffff:c000:201, ipv4_compatible ::192.0.2.1, and ipv4_compatible_hex ::c000:201. Malformed octets, out-of-range hextets, multiple double-colon compressions, and IPv6 addresses outside the mapped or compatible prefixes fail with invalid_input and are not billed.

Where an IPv4-mapped IPv6 converter earns its keep

Application developers dual-stacking listeners compare getpeername results that arrive as IPv4-mapped IPv6 against allow-lists stored as dotted quads; calling this API once normalizes both sides.

What does the IPv4-mapped IPv6 converter cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →