Enter an IPv6 address and click Compress or Expand
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 addresses can be compressed using two methods:
0042 becomes 42, 0000 becomes 0.::. This can only be used once per address.Example: 2001:0db8:0000:0000:0000:ff00:0042:8329 → 2001:db8::ff00:42:8329
| 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 |
| 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 |
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));
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.