Menu

IPv4 and IPv6

Every device connected to the internet needs an IP address so that data can be delivered to the right place. There are two versions in use: IPv4 and IPv6. They differ in how many bits they use and in how they are written down.

IPv4

IPv4 addresses are 32-bit numbers. They are written as four decimal numbers separated by dots, and each number is between 0 and 255 because 8 bits can store 256 different values. Four groups of 8 bits give 32 bits in total, so there are 2 to the power of 32 possible IPv4 addresses, which is about 4.3 billion.

For example, 173.42.8.211 is a valid IPv4 address: four decimal numbers, each one 8 bits, joined by dots. As more and more devices came online, IPv4 addresses began to run out, so a larger version was needed.

IPv6

IPv6 addresses are 128-bit numbers. They are written in hexadecimal, using the digits 0 to 9 and the letters a to f, because each hexadecimal digit stands for exactly 4 bits. An IPv6 address has eight groups of four hex digits separated by colons, and each group is 16 bits: 8 groups of 16 bits is 128 bits.

For example, 3f1a:00c8:b45d:7e02:119f:6a3b:00d4:9e50 is an IPv6 address. With 128 bits there are 2 to the power of 128 possible addresses, an enormous number, which means running out of addresses is no longer a problem.

Comparing the two

VersionNumber of bitsHow it is written
IPv432Four decimal numbers separated by dots
IPv6128Eight groups of four hexadecimal digits separated by colons

Practise this