IPv6 Address Compressor & Expander Online – Free | 8gwifi.org

IPv6 Address Compressor & Expander

128-bit Compression Expansion Client-Side
Anish Nath
IPv6 Address Input
IPv6 Address
Results

Enter an IPv6 address and click Compress or Expand

Understanding IPv6 Addresses
What is IPv6?

IPv6 (Internet Protocol version 6) is the most recent version of the Internet Protocol, designed to replace IPv4. IPv6 addresses are 128-bit identifiers represented as eight groups of four hexadecimal digits, separated by colons. Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

IPv6 Address Compression Rules

IPv6 addresses can be compressed using two methods:

  • Leading Zero Compression: Leading zeros in each group can be omitted. 0042 becomes 42, 0000 becomes 0.
  • Consecutive Zero Compression: The longest sequence of consecutive all-zero groups can be replaced with ::. This can only be used once per address.

Example: 2001:0db8:0000:0000:0000:ff00:0042:83292001:db8::ff00:42:8329

IPv6 Address Types
Type Prefix Description
Global Unicast 2000::/3 Globally routable addresses, similar to public IPv4
Link-Local fe80::/10 Used for communication on a single network link
Unique Local fc00::/7 Similar to private IPv4 addresses (RFC 4193)
Multicast ff00::/8 One-to-many communication
Loopback ::1 Equivalent to 127.0.0.1 in IPv4
Unspecified ::/128 All zeros, equivalent to 0.0.0.0
IPv6 vs IPv4 Comparison
Feature IPv4 IPv6
Address Length 32 bits 128 bits
Address Space 4.3 billion 340 undecillion
Address Format Dotted decimal (192.168.1.1) Hexadecimal groups (2001:db8::1)
NAT Required Often Not required
IPsec Support Optional Built-in
Code Examples

Python

import ipaddress

# Expand IPv6
addr = ipaddress.IPv6Address('2001:db8::1')
print(addr.exploded)  # 2001:0db8:0000:0000:0000:0000:0000:0001

# Compress IPv6
addr = ipaddress.IPv6Address('2001:0db8::1')
print(addr.compressed)  # 2001:db8::1

JavaScript

// Validate IPv6
function isValidIPv6(addr) {
    const pattern = /^([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$/i;
    return pattern.test(addr.replace('::', ':'));
}

// Expand compressed IPv6
const expanded = addr.replace(/::/, 
    ':'.repeat(8 - addr.split(':').length + 1));

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.