IPv6 Expander & Compressor
Expand a shorthand IPv6 address (with '::') into its full 8-group form, and compress any IPv6 address to its RFC 5952 canonical form. Paste either form — 2001:db8::1 or 2001:0db8:0000:0000:0000:0000:0000:0001 — and get both representations at once. Handles CIDR suffixes and embedded IPv4 tails.
Input
Compressed (2001:db8::1) or full (2001:0db8:...:0001). A CIDR suffix (/64) and an embedded IPv4 tail (::ffff:192.168.1.1) are supported.
Output
Guides
Expand and compress IPv6 addresses instantly
IPv6 addresses can be written two ways: a long full form with eight groups of four hexadecimal digits, or a short compressed form that drops leading zeros and collapses runs of zero groups into ::. This tool converts between them in both directions at once. Paste an address in either form and you immediately get the fully-expanded 8-group version and the canonical compressed version, so you never have to guess which representation a router, firewall rule, or config file expects.
How to use it
Type or paste an IPv6 address into the input field. The tool auto-runs and fills in two outputs:
- Expanded — all eight groups, each padded to four hex digits (e.g.
2001:0db8:0000:0000:0000:0000:0000:0001). - Compressed — the RFC 5952 canonical form, with leading zeros stripped, letters lowercased, and the longest run of zero groups replaced by
::(e.g.2001:db8::1).
Both fields have a copy button. There is nothing to submit and nothing leaves your browser.
What forms are accepted
- Compressed shorthand with a single
::, including edge cases like::1(loopback),::(all zeros),fe80::1, and1::. - Full 8-group addresses, with or without leading zeros.
- CIDR suffixes such as
/64. The prefix length is validated (0–128), kept aside during conversion, and re-attached to both results unchanged. - Embedded IPv4 tails such as
::ffff:192.168.1.1. The trailing dotted-quad is converted into two hex groups, so both outputs are pure hexadecimal (::ffff:c0a8:101).
How does compression work?
The tool follows RFC 5952, the canonical text representation standard. It lowercases every hex digit, removes leading zeros from each group, then finds the first longest run of two or more consecutive all-zero groups and replaces it with ::. A single zero group is never collapsed, and when two runs tie in length the earliest one wins — the same rules routers and operating systems use, so the output matches what your tooling produces.
Why show both forms?
Different systems disagree about which form to use. Documentation and logs often use compressed form for readability, while some parsers, spreadsheets, and diff tools want the fixed-width expanded form so every address lines up. Producing both at once removes the round-trip.
Is my address sent anywhere?
No. All parsing and conversion run entirely in your browser with plain string math. Nothing is uploaded, logged, or stored.
What counts as invalid?
The tool rejects addresses with more than one ::, more than eight groups, a group longer than four hex digits, non-hex characters, a misplaced IPv4 tail, or a CIDR prefix outside 0–128 — with a message explaining the problem.
Use it from code
From 3 credits per callREST API
curl -X POST https://api.iotools.cloud/v1/tool/ipv6-expander \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"address": "2001:db8::1"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `ipv6-expander` tool (IPv6 Expander & Compressor) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.