Skip to content
OddsockLocal
Local
Source text

The preview shows up here.

ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Enter an IPv6 address. Add /prefix if you want the network and the count.
  2. Read the compressed form and the fully expanded form.
  3. With a prefix, read the network, the last address and the number of addresses.
  4. A missing prefix is reported as /128, one address.

What is IPv6 calculator?

IPv6 text has too many ways to write the same address. The calculator compresses the longest run of zeros, expands every group to four hex digits, and, when you include a prefix, reports the network, the last address and the count. 1:0:0:2:0:0:3:4/64 compresses to 1::2:0:0:3:4. The first run of zeros is longer than the later one, so the double colon sits there, not in front of 3. The /64 contains 18446744073709551616 addresses.

Read more

Without a prefix, the address is treated as a /128, a single address. 2001:db8::1 alone comes back compressed as itself, expanded as 2001:0db8:0000:0000:0000:0000:0000:0001, network 2001:db8::1/128, and a count of 1. An IPv4 tail such as ::ffff:192.0.2.1 is accepted and expanded to 0000:0000:0000:0000:0000:ffff:c000:0201.

Two double colons, as in 1::2::3, are rejected. A prefix has to sit between 0 and 128. This page does not split the prefix into subnets; the splitter does that, including for IPv6 when the address contains a colon.

Use cases

  • A config file and a log disagree about 1:0:0:2:0:0:3:4 versus 1::2:0:0:3:4, and you need them shown as the same address.
  • A /64’s size should be the full 2^64 count, not a rounded “huge.”
  • An IPv4-mapped address has to be expanded to eight groups before a comparator that does not understand ::ffff:.
  • A typo with two :: marks should fail instead of being parsed as a guess.

Which run of zeros the double colon replaces

1:0:0:2:0:0:3:4/64

compressed 1::2:0:0:3:4. The /64 contains 18446744073709551616 addresses.

Why use Oddsock

Compression keeps the first longest zero run. Putting the :: in the shorter run is a different string for the same address, and matchers that compare text will miss it.

Related tools

Using this tool

The first zero run is three groups and the later one is two. Compression uses the first longest run, so the double colon replaces 0:0:0 after the leading 1.