How to convert an IPv6 address to a MAC address
You can convert an IPv6 address back to a MAC address only when the IPv6 interface identifier was derived from that MAC with the EUI-64 method. This is most common with older link-local addresses that start with fe80:: and some stateless autoconfigured addresses.
When it works
This reverse conversion works when the last 64 bits of the IPv6 address still contain an EUI-64 interface identifier.
- The interface identifier was built from a 48-bit MAC address.
- The middle bytes are still ff:fe.
- The address was not generated by privacy extensions or another randomization scheme.
How the conversion works
The converter rebuilds the MAC address with these steps:
- Read the last 64 bits of the IPv6 address.
- Remove the inserted ff:fe bytes from the middle of the interface identifier.
- Flip the universal/local bit in the first byte.
- Format the remaining 48 bits as a standard MAC address.
Why no MAC address appears
You may not get a result for several reasons:
- The IPv6 address is not syntactically valid.
- The address is valid, but it was not generated from a MAC address with EUI-64.
- The address uses privacy, stable-random, DHCPv6, or another non-MAC-based assignment method.