There are approximately 4.29 billion available IPv4 addresses and 340 undecillion IPv6 addresses. This massive difference exists because IPv4 uses a 32-bit numbering system while IPv6 uses a 128-bit system to accommodate the growth of the internet.

IPv4 Limits and the 32-Bit Constraint

An IPv4 address consists of four octets, each ranging from 0 to 255, separated by dots. Because each octet is 8 bits, the total address length is 32 bits. The mathematical limit is calculated as 2 to the power of 32, which equals 4,294,967,296 unique addresses.

While 4.29 billion sounds large, it is insufficient for the global population of connected devices. Every smartphone, laptop, smart bulb, and server requires a unique identifier to communicate across the public internet. When these addresses are exhausted, new devices cannot be assigned a unique public identity without a mechanism to share addresses.

You may encounter a misconception that every device in your home has a unique public IPv4 address. In reality, most home networks use a single public IP address provided by the Internet Service Provider (ISP). Your router then assigns private IP addresses to your internal devices. This process, known as Network Address Translation (NAT), allows hundreds of devices to share one public address, effectively stretching the limited IPv4 pool.

IPv6 Capacity and 128-Bit Addressing

IPv6 was developed to solve the exhaustion of IPv4 addresses by expanding the address space to 128 bits. This change increases the number of possible addresses to 2128, which is roughly 340 undecillion. Written out, this is 340,282,366,920,938,463,463,374,607,431,768,211,468,926,718,325,203,255,830,091,281,952 addresses.

IPv6 addresses are written in hexadecimal format, using eight groups of four characters separated by colons. This format allows for an almost infinite number of addresses, ensuring that every grain of sand on earth could theoretically have its own IP address. This removes the need for NAT in most scenarios, allowing for true end-to-end connectivity where every device has a globally unique address.

Because the number is so vast, IPv6 addresses are typically assigned in large blocks. A standard home network assignment is usually a /64 prefix, which provides 18,446,744,073,709,551,616 addresses for a single local network. This ensures that you will never run out of addresses for your internal devices regardless of how many smart gadgets you add to your home.

Calculating Address Space with Binary Math

To understand how the number of addresses is determined, you must look at the binary structure of the address. Computers read IP addresses as strings of 1s and 0s. The number of possible combinations is determined by the formula 2n, where n is the number of bits.

IPv4 Calculation Example

In IPv4, n = 32. The calculation is 232. To visualize this, imagine 32 slots that can each be either a 0 or a 1. The first slot has 2 possibilities, the second has 2, and so on. Multiplying 2 by itself 32 times results in 4,294,967,296. If you subtract reserved ranges, such as those for private networks (10.0.0.0/8) and loopback addresses (127.0.0.0/8), the number of usable public addresses is slightly lower.

IPv6 Calculation Example

In IPv6, n = 128. The calculation is 2128. This is not just a linear increase but an exponential one. While IPv4 is 32 bits, IPv6 is four times as long in bits, but the resulting number of addresses is trillions of times larger. For example, if you had a network with a /48 prefix, you would have 2(128-48)} or 280 addresses. This equals 1,208,925,819,614,629,174,606,894,285,312 addresses for one organization.

Reserved and Unusable Address Ranges

Not every possible IP address is available for general use on the public internet. Certain blocks are reserved for specific technical functions to ensure the network remains stable and manageable.

In IPv4, the 127.0.0.0/8 range is reserved for loopback testing. This means the address 127.0.0.1 always refers to the device you are currently using. If you try to ping this address, the data never leaves your network card; it simply loops back to your own operating system. This is used by developers to test software on their own machine before deploying it to a server.

Another critical reservation is the private IP range. Addresses starting with 10.x.x.x, 172.16.x.x through 172.31.x.x, and 192.168.x.x are designated for local area networks (LANs). These addresses are not routable on the public internet. If you see an address like 192.168.1.1, it is a private address used inside your home. This is why millions of homes can use the exact same internal IP addresses without conflicting with each other; they are isolated behind a router.

IPv6 also has reserved spaces. For example, addresses starting with fe80:: are link-local addresses. These are only valid within a single network segment and cannot be routed across the internet. They are used for basic neighbor discovery and automatic configuration, allowing devices to communicate immediately after plugging in, even before they receive a global address from a server.

Transitioning Between IPv4 and IPv6

Since the world cannot switch all servers and routers to IPv6 instantly, several transition mechanisms exist to allow the two protocols to coexist. You will often find that your device has both an IPv4 and an IPv6 address simultaneously.

Dual Stack is the most common method. In this setup, a network interface is configured with both an IPv4 and an IPv6 address. When you try to visit a website, your computer checks if the destination supports IPv6. If it does, it uses the IPv6 address for a faster and more direct connection. If the destination only supports IPv4, the computer falls back to the older protocol.

Tunneling is another method where IPv6 packets are wrapped inside IPv4 packets to move across an IPv4-only part of the internet. This is similar to putting a letter inside a larger envelope to get it through a postal system that only recognizes the larger envelope's format. Once the packet reaches an IPv6-compatible router, the IPv4 wrapper is removed, and the original IPv6 packet is delivered.

To check which version you are currently using, you can look at your network settings. On most operating systems, you can find this by navigating to Settings > Network & Internet > Properties. Labels may differ by version, but you will typically see an "IPv4 address" (e.g., 192.168.1.15) and an "IPv6 address" (e.g., 2001:db8::1) listed in the same menu.