IPv6 Shorthand Calculator

Paste an IPv6 address. 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. fe80:0000:0000:0000:0202:b3ff:fe1e:8329 becomes fe80::202:b3ff:fe1e:8329. Compress, not ping.

RFC 5952 compress and expand, not ping and not a routing table. IPv4 masks live on the IP Subnet / CIDR Calculator.

Input data

Options

Results

Enter data and click Calculate.

How it works

IPv6 Shorthand Calculator in this calculator compresses or expands hextets. 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. fe80:0000:0000:0000:0202:b3ff:fe1e:8329 becomes fe80::202:b3ff:fe1e:8329. ::ffff:c000:201 stays ::ffff:c000:201. This is not ping.

Field ipv6-input is text. Checkbox ipv6-show-ipv4-mapped is on in the third example; the result still stays in hextets. The calculator strips leading zeros and places one ::. It does not parse dotted ::ffff:192.0.2.1.

2001:db8::1 is not a ping6 reply. fe80::202:b3ff:fe1e:8329 is not an ND neighbour. You type the address. The calculator does not query an interface and does not read a table.

IP Subnet / CIDR next door counts IPv4 hosts. MTU counts fragments. Here 2001:0db8:...:0001 stays 2001:db8::1, RFC 5952 shorthand alone.

Paste the full 2001:0db8:0000:0000:0000:0000:0000:0001, then Calculate. The result is 2001:db8::1. A blank field is an address error. This is not traceroute.

2001:0db8:...:0001 becomes 2001:db8::1. fe80:... becomes fe80::202:b3ff:fe1e:8329. ::ffff:c000:201 stays ::ffff:c000:201. Another zero run changes ::.

Formula

RFC 5952: strip leading zeros, one :: on the longest zero run. Compress and expand, not ping.

How to use

  1. Paste 2001:0db8:0000:0000:0000:0000:0000:0001.
  2. Click Calculate. The shorthand is 2001:db8::1.
  3. fe80:0000:0000:0000:0202:b3ff:fe1e:8329 becomes fe80::202:b3ff:fe1e:8329.
  4. RFC 5952 compress, not ping.
  5. Count IPv4 hosts on the IP Subnet / CIDR Calculator.

2001:0db8:...:0001 = 2001:db8::1

RFC 5952 compress. 2001:0db8:...:0001 becomes 2001:db8::1. This is not ping.

Shorthand
One :: and no leading zeros. 2001:db8::1 from the full paste. Not ping.
Calculator
Text in ipv6-input. fe80:... leaves fe80::202:b3ff:fe1e:8329.
IPv6
Hextets, not dotted. ::ffff:c000:201 stays in that form.

Examples

Example 1

  • 2001:0db8:0000:0000:0000:0000:0000:0001

2001:db8::1

What shorthand is 2001:0db8:0000:0000:0000:0000:0000:0001? 2001:db8::1. Compress, not ping.

Example 2

  • fe80:0000:0000:0000:0202:b3ff:fe1e:8329

fe80::202:b3ff:fe1e:8329

What shorthand is fe80:0000:0000:0000:0202:b3ff:fe1e:8329? fe80::202:b3ff:fe1e:8329.

Example 3

  • ::ffff:c000:201
  • IPv4-mapped on

::ffff:c000:201

What about ::ffff:c000:201 with IPv4-mapped on? ::ffff:c000:201. Hextets, not dotted.

Related calculators

Common questions

What shorthand is 2001:0db8:0000:0000:0000:0000:0000:0001?

2001:db8::1. One ::, no leading zeros. Not ping.

What about fe80:0000:0000:0000:0202:b3ff:fe1e:8329?

fe80::202:b3ff:fe1e:8329. The same RFC 5952.

What about ::ffff:c000:201?

It stays ::ffff:c000:201. The calculator does not turn it into 192.0.2.1.

Is this ping or traceroute?

No. Hextets from the field. No ICMPv6.

Does dotted ::ffff:192.0.2.1 work?

No. Type hextets, as in the third example ::ffff:c000:201.

Why the IPv4-mapped checkbox?

It shows a mapped note. The shorthand still stays in hextets.

Are two :: legal?

No. RFC 5952 keeps one :: on the longest zero run.

Where do I count IPv4 hosts?

On the IP Subnet / CIDR Calculator. Here IPv6 shorthand stays.

Does a blank field count?

No. Without an address the calculator stops. This is not a routing table.

Knowledge sources

The calculator counts bits, bytes or throughput from your numbers. Below are SI and bit definitions (NIST).

Page updated in 2026.

What IPv6 shorthand means

An IPv6 address is 128 bits, written as eight hextets (groups of 4 hex digits) separated by colons, e.g. 2001:0db8:0000:0000:0000:ff00:0042:8329. Shorthand (compressed form) is the same value written shorter per RFC 5952: no unnecessary leading zeros, and at most one :: replacing the longest run of zero hextets.

This calculator accepts any valid form (full, partially shortened, mixed case) and returns the canonical compressed form plus the expanded form β€” useful when comparing logs, ACLs, AAAA records, and host configs.

Compression rules (RFC 5952)

  • Leading zeros in hextets β€” drop them: 0db8 β†’ db8, 0042 β†’ 42. A zero hextet is 0, not an empty field.
  • :: only once β€” it replaces the longest run of at least two consecutive zero hextets. A second :: makes the address ambiguous.
  • Length ties β€” if two zero runs are equally long, compress the leftmost one.
  • Lowercase β€” recommended output uses a–f, not A–F.
  • Do not use :: for a single zero β€” a lone 0 hextet stays as 0 (unless it is part of a longer zero run).

Expanded vs compressed

  • Expanded β€” always 8Γ—4 hex digits: easier sorting, diffs, and naive string matches in firewalls.
  • Compressed β€” clearer in DNS AAAA, interface configs, and docs.
  • Partial shorthand β€” e.g. leading zeros removed but no ::; valid but not canonical. The calculator normalizes to RFC 5952.

Same 128 bits: 2001:0db8:0000:0000:0000:ff00:0042:8329 = 2001:db8::ff00:42:8329.

Common mistakes

  • Using :: twice in one address.
  • Leaving leading zeros in β€œcompressed” form (2001:0db8::1 β€” prefer 2001:db8::1).
  • Confusing hextets with bytes β€” IPv6 groups 16-bit chunks, not IPv4-style octets.
  • Pasting dotted IPv4 without mapping (::ffff:192.0.2.1 is the IPv4-mapped form).
  • Assuming β€œmost zeros on the right” always wins β€” ties go to the left.

Worked examples

1) Documentation prefix

Full input: 2001:0db8:0000:0000:0000:ff00:0042:8329

  • Drop leading zeros β†’ 2001:db8:0:0:0:ff00:42:8329
  • Longest zero run: three hextets 0:0:0 β†’ ::
  • Compressed: 2001:db8::ff00:42:8329

2) Leading zeros only (no ::)

2001:0db8:0001:0002:0003:0004:0005:0006 β†’ 2001:db8:1:2:3:4:5:6 (no two consecutive zero hextets, so no ::).

3) :: only once

2001:db8:0:0:1:0:0:1 β€” two runs of two zeros; compress the left: 2001:db8::1:0:0:1 (RFC 5952 leftmost on a tie).

4) Loopback

0000:0000:0000:0000:0000:0000:0000:0001 β†’ ::1.

5) Link-local

fe80:0000:0000:0000:0202:b3ff:fe1e:8329 β†’ fe80::202:b3ff:fe1e:8329. The fe80::/10 prefix stays; compression only collapses the zero run after it.

6) Leading-zero cleanup only

Input 2001:0db8:0:0:0:0:0:1 is already partly shortened. Canonical: 2001:db8::1 β€” the calculator finishes RFC 5952 (lowercase + a single ::).

Quick cheat sheet: input β†’ shorthand (RFC 5952)

A few canonical pairs β€” paste the left column into the calculator to confirm the result.

Input (expanded / partial)Canonical shorthandRule applied
2001:0db8:0000:0000:0000:ff00:0042:83292001:db8::ff00:42:8329leading zeros + one ::
2001:0db8:0001:0002:0003:0004:0005:00062001:db8:1:2:3:4:5:6leading zeros only (no ::)
2001:db8:0:0:1:0:0:12001:db8::1:0:0:1equal-length runs β†’ compress leftmost
0000:0000:0000:0000:0000:0000:0000:0001::1loopback
fe80:0000:0000:0000:0202:b3ff:fe1e:8329fe80::202:b3ff:fe1e:8329link-local + ::

When to use shorthand in practice

  • AAAA records / docs β€” compressed form is easier for humans; tools normalize anyway.
  • ACL / SIEM logs β€” expanded form can make naive text sorts predictable; or normalize before compare.
  • Router configs β€” IOS/FRR/Linux usually accept both; pick one team convention.
  • Debug β€” if a client β€œwon’t connect”, expand in the calculator and compare bit-for-bit with the interface address (ip -6 addr).

Remember: shorthand does not change the address value β€” only the notation. A typo still compresses into a β€œpretty” wrong address β€” always verify against the source (SLAAC, DHCPv6, VLAN docs).