An IPv4 address can be converted to an RFC 4291 IPv4-mapped IPv6 address by placing its original 32 bits after 80 zero bits and a 16-bit FFFF marker, producing one 128-bit value.
This is an IPv4-to-IPv6 mapping, not an allocation of native IPv6 space. The example below follows a single address through the mapped format, compares the three available notations, and shows the validation required before an application consumes the result.

What the 128-bit mapped format contains
An IPv4-mapped IPv6 address has three fixed parts. The first 80 bits are zero, the next 16 bits are the FFFF marker, and the final 32 bits contain the unchanged IPv4 address. The total is 128 bits, matching the size of an IPv6 address.
- 80 zero bits: These create the reserved leading portion of the mapped prefix.
- 16 one bits: These are written as FFFF and distinguish the RFC 4291 mapped form.
- 32 IPv4 bits: These preserve the numeric value of the source address in the low-order portion.
The rule comes from RFC 4291, section 2.5.5.2. Mapped addresses can appear in APIs and dual-stack software that represent an IPv4 node inside an IPv6-sized structure. They do not, by themselves, provide routing, packet translation, or native public IPv6 connectivity.
Convert 192.0.2.1 step by step
- Enter one strict IPv4 address. Open the IPv4 to IPv6 Converter and enter 192.0.2.1. The input must contain exactly four decimal octets, each from 0 through 255. Do not include spaces, signs, shortened octets, hexadecimal notation, a CIDR suffix, or leading zeroes. Hostnames are not resolved. The converter runs entirely in the browser, performs no lookup, and stores nothing.
- Create the RFC 4291 mapped representation. The two IPv4 octet pairs become two 16-bit hexadecimal words. The formula for each word is (first octet × 256) + second octet. For this one example, substituting (192 × 256) + 0 produces c000, while (2 × 256) + 1 produces 0201. The result is the low-order value c000:0201. Placing the 80 zero bits and the FFFF marker before it completes the 128-bit mapped address.
-
Choose the destination notation. Select mixed, compressed hexadecimal, or expanded hexadecimal. For the same input of 192.0.2.1, the converter produces:
- Mixed notation: ::ffff:192.0.2.1
- Compressed hexadecimal: ::ffff:c000:201
- Fully expanded hexadecimal: 0000:0000:0000:0000:0000:ffff:c000:0201
- Copy the form required by the destination. Use the converter’s separate copy controls to select the appropriate spelling for a configuration file, test, database, or diagnostic note. Mixed notation keeps the familiar dotted-decimal ending, compressed notation removes unnecessary hexadecimal zeroes, and expanded notation pads every 16-bit group to four digits.
- Parse and normalize before deployment. Pass the copied value through the destination platform’s maintained IP-address library and accept its normalized form. This is essential because a library, framework, or operating system may preserve one spelling while rewriting another. Do not treat visually different strings as proof that the addresses have different values.
Compare the three output notations
| Notation | How it presents the bits | Practical use | Important consideration |
|---|---|---|---|
| Mixed | Uses ::ffff: followed by the original dotted-decimal IPv4 address. | Readable review, mixed-format APIs, and systems that explicitly accept the dotted tail. | The receiving component may normalize, preserve, or reject this spelling. |
| Compressed hexadecimal | Shows hexadecimal 16-bit groups and removes leading zeroes within those groups. | Compact configuration and diagnostic text where hexadecimal notation is accepted. | It is shorter, but the same address may still be rendered differently elsewhere. |
| Expanded hexadecimal | Pads all eight 16-bit groups to four hexadecimal digits. | Exact-width inspection and environments that expect a fully written address. | It is longer but makes the complete 128-bit group layout easier to inspect. |
These are notation choices, not different address families or different scopes. The fully expanded form makes the group structure visible, the compressed form reduces the text, and the mixed form makes the embedded IPv4 value easy to recognize.
For code that handles mapped addresses, Python’s IPv6Address.ipv4_mapped documentation shows how a standard library can identify a mapped address. In general, compare parsed or normalized addresses rather than raw text.
Check the destination before using the value
Application behavior is not uniform. Some socket APIs expose an IPv4 peer as an IPv4-mapped IPv6 address when an IPv6 listener accepts both protocol families. Access-control lists, logs, databases, proxies, and web frameworks may normalize the address, preserve the mixed form, or reject it.
Test the exact consumer that will receive the value. A string-prefix check is not a reliable substitute for parsing and applying mapped-IPv4 semantics. For example, a firewall rule that recognizes only native IPv6 behavior may not behave as expected when the underlying peer is IPv4.
Classify the original IPv4 address separately when policy distinguishes private, loopback, multicast, documentation, or globally reachable ranges. Mapping the value into 128 bits does not change the scope of its embedded IPv4 address. Similarly, a database index or equality check should use a parsed or consistently normalized value rather than assuming every component will store the same textual form.
For production code, cross-check the generated value with the destination platform’s IP-address library and record whether that component expects IPv4-mapped addresses at all. If it does not, preserving the source address in mapped notation may be less appropriate than handling the IPv4 and IPv6 cases separately.
Where mapped addresses fit in dual-stack systems
Mapped addresses are most relevant where software already understands IPv6-sized address structures but still needs to identify an IPv4 peer. They can simplify internal representation or provide predictable test data for APIs that accept mapped values. The output is useful as a representation of the existing IPv4 bits, but the surrounding application must understand how those bits should be interpreted.
Do not treat a mapped address as a converted public endpoint. It does not:
- Allocate native IPv6 address space.
- Create an IPv6 route.
- Translate packets between protocols.
- Make an IPv4-only service reachable through the public IPv6 Internet.
- Change an IPv4 address’s private, loopback, or other scope classification.
The IPv4 to IPv6 Converter deliberately emits only the RFC 4291 mapped form. It does not silently choose 6to4, NAT64, SIIT, DNS64, or another transition mechanism, because those mechanisms use different prefixes and have different operational behavior.
Keep mapped addresses separate from other transition formats
The deprecated IPv4-compatible form is not the same as the mapped form. RFC 4291 explicitly deprecates the old compatible form and defines the separate FFFF marker used for IPv4-mapped addresses. A result beginning with a different transition prefix should not be substituted for a mapped result.
NAT64 and DNS64 also solve different problems. NAT64 is associated with translating IPv6-only clients that need to reach IPv4 services, while DNS64 synthesizes IPv6 addresses for selected IPv4 destinations. 6to4 and SIIT have their own prefixes and deployment requirements. None is selected merely because an IPv4 address is being placed into an IPv6 context.
If the actual task is subnet planning, native IPv6 assignment, or translation-service configuration, use standards and tools designed for that separate workflow. For example, calculate an IPv6 subnet mask step by step addresses native subnet structure rather than IPv4-mapped representation.
A production-ready conversion checklist
- Confirm that the destination component explicitly supports IPv4-mapped IPv6 addresses.
- Select the notation required by that component rather than choosing solely for appearance.
- Parse the copied value with a maintained IP-address library.
- Normalize the value before storing, comparing, or logging it.
- Apply scope and access rules to the embedded IPv4 address with mapped semantics in mind.
- Keep routing, transition, and native IPv6 deployment decisions separate from the text conversion.
If you're weighing options, How to Find and Verify an IPv6 Subnet Prefix covers this in detail.