# ipv6Unpack() function · @imqueue/net

Source: https://imqueue.org/api/net/latest/net.ipv6unpack/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/net 3.0.2 — generated reference, not hand-written

Expands an IPv6 address to its full eight-group, four-digit form.

**Signature:**

```typescript
export declare function ipv6Unpack(ip: string): string;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| ip | string | an IPv6 address, compressed or not |


**Returns:**

string

The 39-character canonical form, e.g. `2001:db8::1` becomes `2001:0db8:0000:0000:0000:0000:0000:0001`.

## Exceptions

TypeError if the address contains more than one `::`.

## Remarks

The inverse of [ipv6Pack()](https://imqueue.org/api/net/latest/net.ipv6pack/), and the form [ipToInt()](https://imqueue.org/api/net/latest/net.iptoint/) needs before it can read the groups as bytes. An input already [IPV6\_MAX\_STR\_LEN](https://imqueue.org/api/net/latest/net.ipv6_max_str_len/) characters long is returned untouched on the assumption it is already expanded.

Dots are rewritten to colons first, so the IPv4-mapped form `::ffff:1.2.3.4` expands without failing — but its trailing octets are treated as hex groups, not as a dotted quad, so the result is not the address a reader would expect. Convert mapped addresses yourself if the exact value matters.

