What is an IPv6 shortener and expander?
An IPv6 shortener and expander converts IPv6 addresses between their full hexadecimal representation and the compressed notation commonly used in network configurations and documentation.
For example, the expanded IPv6 address 2001:0db8:0000:0000:0000:ff00:0042:8329 can be shortened to 2001:db8::ff00:42:8329. Both values represent exactly the same 128-bit IPv6 address.
What is IPv6?
IPv6 stands for Internet Protocol version 6. It was developed to provide a much larger address space than IPv4. An IPv6 address contains 128 bits compared with 32 bits in an IPv4 address.
IPv6 addresses are normally written as eight groups of four hexadecimal digits separated by colons. Each group represents 16 bits, giving a total of 128 bits.
How does IPv6 compression work?
IPv6 compression makes addresses easier to read by removing unnecessary leading zeros from each hexadecimal group. For example, 0db8 can be written as db8 and 0042 can be written as 42.
A consecutive sequence of all-zero groups can also be replaced by a double colon (::). This replacement can be used only once in an IPv6 address because otherwise it would be impossible to determine how many zero groups were removed.
IPv6 compression rules
Remove leading zeros
Leading zeros inside a hexadecimal group may be omitted. For example, 0042 becomes 42 and 0db8 becomes db8.
Keep at least one digit
A group containing 0000 becomes 0 when written individually. The entire group cannot simply disappear unless it is part of :: compression.
Compress consecutive zero groups
A continuous sequence of zero groups can be represented by :: to shorten the address.
Use :: only once
A double colon can appear only once in a valid IPv6 address because it represents an unspecified number of consecutive zero groups.
How does IPv6 expansion work?
To expand a compressed IPv6 address, the omitted zero groups are restored until the address contains exactly eight groups. Each group is then padded with leading zeros until it contains four hexadecimal digits.
For example, 2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001.
How to use the IPv6 converter
- Enter either a compressed or fully expanded IPv6 address.
- Click Convert IPv6.
- The tool validates the IPv6 hexadecimal groups.
- Review both the compressed and fully expanded forms of the address.
- Use the Copy buttons to copy either result.
IPv6 shortening example
In this example, leading zeros are removed from individual groups and the longest sequence of consecutive zero groups is replaced by ::.
IPv6 vs IPv4
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address Length | 32 bits | 128 bits |
| Typical Format | 192.168.1.10 | 2001:db8::1 |
| Number System | Decimal | Hexadecimal |
| Separator | Periods | Colons |
| Groups | 4 octets | 8 hexadecimal groups |
Why are IPv6 addresses so long?
IPv6 uses 128-bit addresses, providing an enormously larger address space than IPv4. The longer hexadecimal notation is the human-readable representation of that 128-bit value.
Compression rules make these addresses more practical to read and type without changing the underlying IPv6 address.
Frequently asked questions
How do I shorten an IPv6 address?
Remove leading zeros from individual hexadecimal groups and replace the longest consecutive sequence of zero groups with ::. The double-colon abbreviation may be used only once.
How do I expand 2001:db8::1?
2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001.
How many groups are in a full IPv6 address?
A fully expanded IPv6 address contains eight hexadecimal groups, with each group containing four hexadecimal digits.
How many bits are in IPv6?
An IPv6 address contains 128 bits. Each of the eight hexadecimal groups represents 16 bits.
Can an IPv6 address contain more than one ::?
No. A valid IPv6 address can use the :: abbreviation only once because it represents one or more omitted zero groups.
Does shortening an IPv6 address change it?
No. Compressed and expanded notation represent the same 128-bit IPv6 address. Compression changes only how the address is written.