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
2001:1620:0028:0001:0b6f:8bca:0093:a116
          ^^   ^^^  ^         ^^

Leading zeroes removed
2001:1620:28:1:b6f:8bca:93:a116
        

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
2001:1620:0028:0000:0000:0000:0000:0116
               ^^^^ ^^^^ ^^^^ ^^^^

Blocks of zeroes omitted
2001:1620:0028::0116
          ^^    ^
Without leading zeroes
2001:1620:28::116