IPv6 Address Basics

IPv6 Address Basics

This short article aims to give a compact overview over the structure of IPv6 addresses.

Address length

The IPv6 address is 128 bits or 16 bytes long and is written in 8 hexadecimal blocks separated by colons. Each block consists of 16 bits or 2 bytes.

Because IPv6 addresses get quite long there are two rules to shorten the address:

  1. Leading zeroes can be omitted in each block
  2. Multiple blocks of zeroes can be omitted once

Leading zeroes

When you write an IPv6 address, you can omit leading zeroes (the ones on the left) in each block:

IPv6 address with leading zeroes
          ^^   ^^^  ^         ^^

Leading zeroes removed

Blocks of zeroes

If one block or multiple joining blocks consist of only zeroes. They can be omitted and written as two colons. Watch out, this may only be done only once per address.

Complete IPv6 address
               ^^^^ ^^^^ ^^^^ ^^^^

Blocks of zeroes omitted
          ^^    ^
Without leading zeroes