IPv6 Expander / Compressor
Expand compressed IPv6 addresses to full notation or compress them.
About this tool
IPv6 addresses are written in hexadecimal and can be quite lengthy—up to 39 characters when fully expanded. To make them easier to read and transmit, IPv6 supports compression techniques that remove leading zeros and replace consecutive zero groups with a double colon. This tool converts between these two formats: expanding compressed addresses to their full notation, or compressing lengthy addresses down to their shortest valid form.
Using the tool is straightforward: paste or type an IPv6 address in either format, select whether you want to expand or compress it, and the result appears instantly in the output field. It automatically detects the format of your input, making it simple to switch between compressed and expanded notation without manual format selection. Whether you're configuring network infrastructure, debugging IPv6 routing issues, or verifying address notation in documentation, this tool handles the conversion reliably.
Network engineers, system administrators, and developers working with modern networks benefit most from this tool, especially when integrating legacy systems that expect full notation or when reading compact addresses from network monitoring systems. IPv6 will become increasingly prevalent as IPv4 address space becomes exhausted, making address manipulation tools like this essential for anyone managing contemporary networks.
Frequently Asked Questions
Code Implementation
import ipaddress
def expand_ipv6(addr: str) -> str:
"""Expand compressed IPv6 to full form."""
return ipaddress.ip_address(addr).exploded
def compress_ipv6(addr: str) -> str:
"""Compress full IPv6 to shortest form."""
return ipaddress.ip_address(addr).compressed
examples = [
"2001:db8::1",
"::1",
"fe80::1",
"2001:0db8:0000:0000:0000:0000:0000:0001",
"::ffff:192.168.1.1", # IPv4-mapped IPv6
]
for addr in examples:
expanded = expand_ipv6(addr)
compressed = compress_ipv6(expanded)
print(f"Input: {addr}")
print(f"Expanded: {expanded}")
print(f"Compressed: {compressed}")
print()Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.