IPv6 Address Representation
IPv6 addresses are 128 bits in length and represented as eight groups of four hexadecimal digits each, each group representing 16 bits. The address can be written in either lowercase or uppercase.
Preferred Format
As we know that IPv6 address is 128 bit and in 8 groups so the preferred format for writing an IPv6 address is x:x:x:x:x:x:x:x, where each “x” containing four hexadecimal values.
Each group of In IPv6 is consisting of 16 bit and the term used for a group is a hextet. So each “x” is a single hextet, 16 bits or four hexadecimal digits.
X : X : X : X : X : X : X : X
0000:0000:0000:0000:0000:0000:0000:0000
To : To : To : To : To : To : To : To
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
If we convert in hextet into binary it should be 16 bit, for example, we 0000 hextet is equal to 0000000000000000 and FFFF hextet is equal to 1111111111111111. Following is the basic relationship table of binary, decimal, and hexadecimal.
Decimal 
Binary 
Hexadecimal 
0  0000  0 
1  0001  1 
2  0010  2 
3  0011  3 
4  0100  4 
5  0101  5 
6  0110  6 
7  0111  7 
8  1000  8 
9  1001  9 
10  1010  A 
11  1011  B 
12  1100  C 
13  1101  D 
14  1110  E 
15  1111  F 
The IPv6 address is written using all 32 hexadecimal digits. It is the ideal method for representing the IPv6 address. But there are two rules which help to reduce the number of digits needed to represent an IPv6 address. Following is the preferred format for
Figure 2 is a review of the relationship between decimal, binary and hexadecimal. Figure 3 has examples of IPv6 addresses in the preferred format for representing the IPv6 addresses.
2001 : 0000 : 0000 : 1111 : 1234 : 0000 : 0000 : 0100
2001 : 0DA1 : B111 : 0000 : 0000 : ABCD : 0000 : 1245
FE80 : 0000 : 0000 : 0000 : 1234 : 4567 : 89AB : CDEF
FE80 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0123
FF02 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001
FE02 : 0000 : 0000 : 0000 : 0000 : 0001 : FF00 : 0200
0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001
0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000
Rule 1 – Omit Leading 0s
Omit leading 0 is the first rule which helps to reduce the notation of IPv6 address. Following are the examples to omit any leading 0s (zeros) in any 16bit section or hextet:

01BC can be represented as 1BC

07FA can be represented as 7FA

0F00 can be represented as F00

00A0 can be represented as A0

000A can be represented as A
This rule only applies to leading 0s, NOT to trailing 0s, otherwise, the address would be ambiguous. The table below shows the examples of omitting leading 0s from IPv6 address.
Rule 2 – Omit All 0 Segments
The second rule to reduce the notation of IPv6 addresses is that a use of double colon (::) that can replace any single, contiguous string of one or more 16bit segments (hextets) consisting of all 0s.
The double colon (::) can only be used once within an address, otherwise there would be more than one possible resulting address. When used with the omitting leading 0s technique, the notation of IPv6 address can often be greatly reduced. This is commonly known as the compressed format.
Incorrect address:
 2001 : : 1111 : 1234 : : 100
Possible expansions of ambiguous compressed addresses: