IPv6 Expand / Compress
Paste any IPv6 address to see both its fully expanded form and the shortest RFC 5952 compressed form — instantly and entirely in your browser.
Updated
How to use IPv6 Expand / Compress
The IPv6 Expand / Compress tool converts any IPv6 address between its two valid written forms, instantly in your browser. Paste a shorthand address such as 2001:db8::1 and it shows the fully expanded form — all eight groups of four hexadecimal digits with leading zeros restored — alongside the shortest legal compressed form that follows RFC 5952. Because the two notations describe the same address, being able to flip between them quickly is essential when comparing config files, copying addresses between systems that expect different formats, or simply checking that a hand-written address is well-formed.
- Paste or type an IPv6 address into the input field.
- Read the fully expanded eight-group form.
- Read the shortest valid compressed form below it.
- Copy whichever notation your target system expects.
- Adjust the input to validate other addresses as needed.
Your data never leaves your device — 100% private processing.
How IPv6 compression works
An IPv6 address is 128 bits, written as eight groups of four hexadecimal digits separated by colons. Two shorthand rules keep it readable. First, leading zeros within any group may be dropped, so 0db8 becomes db8 and 0000 becomes 0. Second, a single run of one or more consecutive all-zero groups may be replaced by a double colon (::). The double colon may appear only once in an address, because more than one would make it ambiguous how many zero groups each represents. RFC 5952 tightens these rules into a single canonical form: lowercase digits, no leading zeros, and the :: applied to the longest zero run (the first one when there is a tie). This tool produces exactly that canonical compressed form while also showing the unambiguous expanded version.
| Expanded | Compressed |
|---|---|
| 2001:0db8:0000:0000:0000:0000:0000:0001 | 2001:db8::1 |
| fe80:0000:0000:0000:0202:b3ff:fe1e:8329 | fe80::202:b3ff:fe1e:8329 |
| 0000:0000:0000:0000:0000:0000:0000:0001 | ::1 |
Why both forms matter
Different systems prefer different notations, and mixing them causes subtle bugs. Logs, firewalls and databases often store the fully expanded form because fixed-width addresses are easy to sort and compare character by character. Humans and most configuration files prefer the compressed form because it is far shorter and easier to read. Problems arise when you compare an address written one way against the same address written another way — a naive string comparison reports them as different even though they are identical. Normalising to a known form before comparing or storing eliminates that class of error. Having both forms in front of you also makes it easy to spot mistakes, such as an extra group, an illegal second ::, or a non-hex character.
Worked examples
Expand shorthand
Inputs: 2001:db8::1
Result: 2001:0db8:0000:0000:0000:0000:0000:0001
Compress loopback
Inputs: 0000:...:0001
Result: ::1
Glossary
- IPv6
- The 128-bit internet addressing scheme that succeeds IPv4, written as eight hexadecimal groups.
- Hextet
- One group of four hexadecimal digits (16 bits) in an IPv6 address.
- Zero compression
- Replacing one run of consecutive all-zero groups with :: to shorten an address.
- RFC 5952
- The standard that defines the single canonical way to write a compressed IPv6 address.
- Zone ID
- An optional %suffix identifying the network interface for a link-local address.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use IPv6 Expand / Compress?
- See the full expanded and shortest compressed form side by side
- Correctly applies RFC 5952 rules for :: zero compression
- Restores leading zeros and missing zero groups when expanding
- Ignores prefix length and zone IDs so any address pastes cleanly
- Runs entirely client-side — addresses never leave your browser
Common use cases
- Compare an address across config files that use different notations
- Normalise IPv6 addresses before storing them in a database
- Verify that a hand-typed IPv6 address is syntactically valid
- Expand a compressed address to count its zero groups
- Teach how IPv6 shorthand notation maps to the full address
Related Network & DNS
Subnet / CIDR Calculator
Calculate network address, broadcast address, usable IP range, and host count for any IPv4 subnet. Free CIDR calculator.
IP Address Converter
Convert IPv4 addresses to decimal, binary, and hexadecimal formats. Also convert decimal numbers back to IP addresses. Free online IP converter.
CIDR / IP Range Expander
Expand a CIDR block or IPv4 range into a list of every address. Shows network, broadcast, first and last host and the total count — calculated in your browser.
DNS Lookup Tool
Look up DNS records for any domain — A, AAAA, MX, NS, TXT, CNAME, SOA, and CAA records. Free, instant results pulled from authoritative nameservers.
DNS Propagation Checker
Check if your DNS changes have propagated worldwide. Test A, MX, and NS records across 8 global DNS servers to confirm updates are live everywhere.
What Is My IP Address?
Instantly find your public IP address. Shows your IPv4 address as seen by websites and servers, plus quick details about your connection.
Explore all Network & DNS.