Convert an IPv4-mapped IPv6 address to full notation

Expand ::ffff:192.0.2.129 into eight IPv6 hextets and confirm the canonical mixed notation for the same address.

Try these inputs

Worked calculation

  1. Convert the dotted bytes to hexadecimal: 192 = c0, 0 = 00, 2 = 02 and 129 = 81.
  2. Combine the two byte pairs as c000 and 0281. Fill the omitted leading groups to get 0000:0000:0000:0000:0000:ffff:c000:0281.
  3. The mapped prefix permits canonical mixed notation ::ffff:192.0.2.129. A /128 keeps all address bits.

Inputs

Prefix lengths
Zero-based. The first child has index 0.

Calculated in your browser

Results

Selected child
::ffff:192.0.2.129/128
Selected leaf
::ffff:192.0.2.129/128
Child prefixes
1

IPv6 prefix tree

IPv6 prefix treeThe parent connects to nearby child prefixes. The selected child connects to nearby leaf prefixes. Full CIDRs and indices appear in the table.::ffff:192.0.2.129/128::ffff:192.0.2.129/128::ffff:192.0.2.129/128::ffff:192.0.2.129/128::ffff:192.0.2.129/128::ffff:192.0.2.129/128/128 → /128 → /128
  • Selected prefix
  • Nearby or parent prefix
The parent connects to nearby child prefixes. The selected child connects to nearby leaf prefixes. Full CIDRs and indices appear in the table.
Parent network
::ffff:192.0.2.129/128
Last address in parent
::ffff:192.0.2.129
Full address
0000:0000:0000:0000:0000:ffff:c000:0281
Compressed address
::ffff:192.0.2.129
Addresses in parent
1
Leaves in selected child
1
Address space
IPv6
Prefixes near the selected indices
LevelIndexPrefixSelection
Child0::ffff:192.0.2.129/128Selected
Leaf0::ffff:192.0.2.129/128Selected

Questions

Does a mapped IPv6 socket address imply the peer used native IPv6?

An IPv4-mapped address can represent an IPv4 peer through a dual-stack socket API. Inspect the endpoint and network separately.

Is decimal 129 written as 81 in the final hextet?

Yes. Decimal 129 equals hex 81, appended to the preceding byte 02 as 0281.

References