Converting IPv6 addresses to binary.


IPv6 address
2001:db8:85a3::8a2e:370:7334 
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Network prefix: 2001:0db8:85a3
Interface ID: 0000:8a2e:0370:7334
Subnet ID: 0 
 CIDR: /64

Binary
0111 0011 0011 0100 
Hexadecimal
7       3      3       4 
 Decimal 29492 


Power Result
 2^0  1
 2^1  2
 2^2  4
 2^3  8
 2^4  16
 2^5  32
 2^6  64
 2^7  128
 2^8  256
 2^9  512
 2^10  1,024
 2^11  2,048
 2^12  4,096
 2^13  8,192
 2^14  16,384
 2^15  32,768


Hexadecimal Decimal
 0
 1
 2
 3
 4
 5
 6
 7
 8
 9
 A 10 
 B 11 
 C 12 
 D 13 
 E 14 
 F 15 

 Hexadecimal 8       A       2       E
 Binary 1000 1010 0010 1110 
 Decimal 35374 

Converting binary to decimal
 1 0
 32,768 16,384  8,192   4,096   2,048 1,024  512  256  128   64 32  16   8  4 2

  32,768 + 2,048 + 512 + 32 + 8 + 4 + 2 = 35,374



IPv4 is 32-bit because 8 bits per octet * 4 octets = 32
IPv6 is 128-bit because 16 bits per piece * 8 pieces = 128


The term pieces is used by the IETF. Hextet and quartet are unofficial.

Back to top