IPv6 Address Compressor
IPv6 Address Compressor. Paste a full address and click Compress in this IPv6 address compressor to get its shortest valid form.
Input IPv6 Address
Example addresses to try:
2001:0db8:0000:0000:0000:0000:0000:0001
fe80:0000:0000:0000:0000:0000:0000:0001
0000:0000:0000:0000:0000:0000:0000:0001
Compressed Result
Enter an IPv6 address to compress
Paste any full IPv6 address to instantly compress it to the shortest valid representation using zero suppression and consecutive group elimination. View the shortened IPv6 notation alongside the original expanded form — perfect for simplifying addresses in DNS records, firewall rules, and network configurations.
Paste in a full-length address and the IPv6 Address Compressor above strips the clutter down to the shortest valid form a router or config file will accept. A 128-bit address written out in full is genuinely painful to read, type, or troubleshoot, and the rules that make it shorter are precise enough that a single misapplied step changes what the address means. Below, you'll find exactly how those rules work, how to shorten ipv6 address values by hand as well as with a tool, and how the compressed form relates back to the expanded one you started with.
How the IPv6 Address Compressor Works
An IPv6 address is a 128-bit number, split into eight 16-bit words written in base-16 and separated by colons. That's a lot of digits to keep straight, which is exactly why an ipv6 compression calculator is useful: it applies a fixed set of rules to shorten the address without changing the value it represents. The math behind the full-length format is simple —
$$8 \times 16\text{-bit words} = 128 \text{ bits}$$
— but eight groups of four hex digits each is unwieldy for a human to scan, remember, or type into a terminal without a typo. Run the same address through an ipv6 address shortener and you get back the same 128-bit value in a form that's actually usable day to day. Whether you call it an ipv6 address compression step, want to ipv6 shorten a value pasted from a log file, or need to shorten ipv6 address output from a script, the underlying process is identical. The same base-16 digits show up in other identifiers too, like a device's MAC address, though IPv6 groups them into 16-bit words rather than the shorter grouping a MAC address uses.
What Compressing an IPv6 Address Actually Means
To compress ipv6 address notation is not the same as changing the address — it's changing how the same value is written. A compressed ipv6 address expands back out to one, and only one, full 128-bit value, provided the rules were applied correctly. That reversibility is the entire point: the compressed form has to be unambiguous, or it stops being useful for anything beyond display.
Hexadecimal Notation and the 128-Bit Address
Where an IPv4 address uses dotted decimal notation — four decimal numbers separated by periods — ipv6 address compression works in colon hexadecimal (sometimes just called colon hex): eight groups of hex digits separated by colons. Each hex digit represents four bits, so a 16-bit word is always exactly four hexadecimal digits, and the eight words together account for the full address space. This hexadecimal notation is denser than decimal, which is one reason compression matters far more for IPv6 than it ever did for IPv4 address formatting.
IPv6 Compression Rules Explained
The ipv6 compression rules that any compressor applies come down to three steps, and they're worth knowing even if you always let a tool handle the compression for you.
Rule 1: Remove Leading Zeros
Within each 16-bit word, any leading zeros can be dropped without changing the value:
- 0db8 becomes db8
- 0042 becomes 42
- 0000 becomes 0 (a word of all leading zeroes still needs one digit)
Note that this rule only works one direction: never trailing zeros, since dropping a trailing zero would actually change the numeric value of the word, not just its appearance — trailing zeroes carry real place value there.
Rule 2: Replace Consecutive Zeros with a Double Colon
This is the rule most people mean when they say "zero compression": a single, unbroken run of consecutive zeros — 16-bit words that are entirely zero, back to back — gets replaced with ::. It's what turns an address like 2001:0db8:0000:0000:0000:ff00:0042:8329 into the far more manageable 2001:db8::ff00:42:8329.
Rule 3: Use the Double Colon Only Once Per Address
Because :: can stand in for any number of zero words, using it twice in the same address makes it impossible to tell how many words each instance represents — the address becomes ambiguous and can no longer be expanded back to a single correct value. When an address has more than one run of zero words, only the longer run gets compressed (or the leftmost one, if both runs are the same length).
Expanded vs. Compressed IPv6 Address Format
Every valid IPv6 address can be written in its fully expanded ipv6 address form or in its compressed equivalent — the table below shows the same underlying addresses both ways, following the rules above in order.
| Expanded IPv6 Address | Compressed Form | Notes |
|---|---|---|
| 2001:0db8:0000:0000:0000:ff00:0042:8329 | 2001:db8::ff00:42:8329 | One run of zero words compressed |
| fe80:0000:0000:0000:74c8:0cb1:8ed5:002c | fe80::74c8:cb1:8ed5:2c | Typical link-local address |
| 0000:0000:0000:0000:0000:0000:0000:0001 | ::1 | Loopback address |
| 0000:0000:0000:0000:0000:0000:0000:0000 | :: | All-zeroes address (unspecified) |
A few conventions keep this address notation consistent across tools: hex letters are written in lowercase letters rather than uppercase, since lowercase reduces confusion between characters like B and 8. Following the same convention every time also matters for de-duplicating address lists — two addresses that are technically identical but formatted differently (one with leading zeroes left in, one without) won't match in a case-sensitive string comparison unless they're first normalized to the same compressed form.
CIDR Notation and Subnet Prefixes
A compressed address is frequently paired with CIDR notation to describe a subnet, written as a slash followed by a prefix length — 2001:db8::/32, for example, describes every address that shares the same first 32 bits. An IPv4 address, by contrast, is built from four decimal octet values separated by periods, and a /24 CIDR block there covers only 256 addresses; an IPv6 subnet routinely covers far more address space per prefix, which is one more reason a compact, colon-separated compressed form matters — a CIDR range gets much harder to reason about when every address inside it is written out in full.
Special IPv6 Addresses: Loopback and Multicast
Special-purpose addresses tend to have long runs of zero words by design, which makes them the clearest illustration of why compression exists in the first place.
The Loopback Address
This address — the equivalent of 127.0.0.1 in IPv4 — is written in full as 0000:0000:0000:0000:0000:0000:0000:0001. Apply rule 1 and it becomes 0:0:0:0:0:0:0:1; apply rule 2 and it collapses to the familiar ::1. It's a compact example of both rules working together on a single address, and it's the address every network device answers to itself.
Multicast, Link-Local, and the All-Zeroes Address
A multicast address, drawn from blocks assigned by IANA, is typically written as something like ff02::1 for the "all nodes" group on a local link — again, mostly zeroes once expanded. The all-zeroes address, used before a device is configured, compresses all the way down to just ::, with no digits at all; this is also called the unspecified address. Link-local addresses on real network devices follow the same pattern: a fixed prefix followed by a long stretch of zeroes that compression collapses into a single double colon.
IPv6 Address Shortener vs. IPv6 Expander: When to Use Each
An ipv6 shortener and an ipv6 expander solve opposite problems, and you'll reach for each one in different situations. Use the ipv6 shortener whenever you need a shorter, more readable form — for documentation, config files, or sharing an address with a colleague. Use the expander when you need to see every word in full, such as when comparing two addresses for an exact match, or when working through an ipv4 to ipv6 migration where the mapped address is embedded in the last two words.
Common Use Cases for Compressed IPv6 Addresses
- Configuring routing tables and static routes on network devices without transcription errors
- Reading DNS records (AAAA entries) and reverse-DNS lookups at a glance
- Documenting subnetting plans for a subnet across an internet protocol network in a way that's actually reviewable
- Comparing or de-duplicating IP address lists pulled from logs or firewall rules
Any of these tasks gets noticeably harder once you're staring at a fully expanded address with a dozen zero-padded words in it — which is really the whole case for keeping a reliable compressor on hand rather than compressing addresses by eye every time.
Validating a Compressed Address Before You Use It
Before pasting a compressed address into a config file, DNS record, or ping command, it's worth a quick sanity check: count the double colons. A syntactically valid compressed address contains at most one :: — if you see two, something upstream already produced an invalid, ambiguous address, and it needs to be expanded and recompressed correctly rather than used as-is. Most command-line networking tools, from ping to traceroute to a router's own CLI, accept the compressed form directly, so there's rarely a reason to type out the full value by hand once you've confirmed it's valid.
Who Actually Uses an IPv6 Address Compressor
In day-to-day networking work, it's usually a network engineer configuring routers or a network administrator auditing firewall rules who reaches for one of these tools — anyone who has to read, compare, or hand-type IPv6 addresses regularly ends up relying on compression rather than working with the expanded form. For a quick one-off lookup or for scripting bulk conversions across an entire subnet, a reliable shortener saves the kind of transcription error that a 128-bit string makes easy to introduce and hard to spot.
Related Network Tools
Explore these related tools for subnet calculation and IP address management.
Additional networking calculators for IP address planning and network analysis.
Comments & Feedback
Share your experience or ask questions about this tool