The total number of available IPv4 addresses is approximately 4.29 billion, specifically 232. The total number of IPv6 addresses is approximately 340 undecillion, or 2128, which is a number so large it effectively provides an infinite supply for the foreseeable future.

IPv4 Capacity and Address Exhaustion

IPv4 uses a 32-bit addressing scheme, meaning every address is a sequence of 32 binary ones or zeros. Because each bit has two possibilities, the mathematical limit is 2 to the power of 32, which equals 4,294,967,296 addresses.

You cannot use all 4.29 billion addresses for individual devices. Large blocks of these addresses are reserved for specific technical purposes. For example, private network ranges (like 192.168.x.x) are used inside homes and offices and are not routable on the public internet. Other blocks are reserved for multicast traffic, loopback testing (127.0.0.1), and experimental use.

The depletion of these addresses led to the creation of Network Address Translation (NAT). NAT allows a single public IP address to represent an entire private network of hundreds of devices. This technique extends the life of the IPv4 pool by ensuring that only the router needs a unique public address, while the phones, laptops, and smart devices inside the house share that one public identity.

IPv6 Expansion and the 128-Bit Scale

IPv6 was designed to replace IPv4 by expanding the address space from 32 bits to 128 bits. This change does not just quadruple the capacity; it increases it exponentially. The total number of addresses is 2128, which is 340,282,366,920,938,463,463,374,607,431,768,211,456.

To put this scale into perspective, there are enough IPv6 addresses to assign billions of addresses to every single grain of sand on Earth. This removes the need for NAT, as every single device—from a light bulb to a server—can have its own unique, globally routable public IP address.

IPv6 addresses are written in hexadecimal (numbers 0-9 and letters a-f) and separated by colons rather than periods. A typical address looks like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. This format allows for much more efficient routing and simplifies the management of massive global networks.

Factors That Reduce Usable IP Counts

When you are managing a specific network or subnet, the "total available" number is always lower than the mathematical maximum. Certain addresses are functionally locked for network operations.

Factor Impact on Usable Addresses Reason
Network Address -1 Address Identifies the network itself; cannot be assigned to a host.
Broadcast Address -1 Address Used to send data to all hosts on the subnet simultaneously.
Gateway Address -1 Address Typically assigned to the router to allow traffic to leave the network.
Reserved Ranges Millions (IPv4) Set aside by IANA for private, loopback, or multicast use.

In a standard IPv4 subnet, you must always subtract at least two addresses (the network and broadcast addresses) to find the number of usable host addresses. If you assign the gateway address to your router, you subtract a third.

Calculating Usable Hosts in a Subnet

To determine how many devices you can fit on a specific network, you use the CIDR (Classless Inter-Domain Routing) notation, which looks like /24 or /27. The number after the slash tells you how many bits are used for the network portion; the remaining bits are for the hosts.

The /24 Subnet

A /24 network is the most common home network configuration. In a 32-bit IPv4 address, if 24 bits are used for the network, 8 bits remain for the hosts (32 - 24 = 8).

1. Calculate the total addresses: 28 = 256.

2. Subtract the network address: 256 - 1 = 255.

3. Subtract the broadcast address: 255 - 1 = 254.

4. Subtract the gateway (router): 254 - 1 = 253.

The total number of usable IP addresses for devices in a /24 subnet is 253.

The /27 Subnet

In a smaller corporate subnet using /27, only 5 bits remain for hosts (32 - 27 = 5).

1. Calculate the total addresses: 25 = 32.

2. Subtract the network address: 32 - 1 = 31.

3. Subtract the broadcast address: 31 - 1 = 30.

4. Subtract the gateway: 30 - 1 = 29.

The total number of usable IP addresses for devices in a /27 subnet is 29.

Rule of Thumb for Quick Estimation

If you need to quickly estimate the size of an IPv4 subnet without a calculator, remember that every time the CIDR number decreases by one, the number of available addresses doubles.

For example, if you know a /24 has 256 total addresses, a /23 has 512, and a /22 has 1,024. Conversely, if you move from a /24 to a /25, you cut the available space in half to 128. Always remember to subtract 2 from your final total to account for the network and broadcast addresses before assigning them to hardware.

Managing IP Pools in Software

When configuring a DHCP (Dynamic Host Configuration Protocol) server to hand out these available addresses, you define a "scope" or "pool." You do not include the network or broadcast addresses in this pool.

To set this up in a standard router or server interface, you typically navigate to Network Settings > DHCP Server > Address Pool. You will enter a Start IP Address and an End IP Address. For a /24 network starting at 192.168.1.0, you might set the pool from 192.168.1.10 to 192.168.1.250. This leaves the first few addresses for static assignments (like servers or printers) and the very last address for the broadcast function. Labels for these menus vary slightly by manufacturer, but the logic of defining a range remains constant.

If you find you are running out of available addresses in your pool, you have two choices: shorten the "Lease Time" (the duration a device holds an address before returning it to the pool) or change the subnet mask to a lower CIDR number (e.g., moving from /24 to /23) to double the available space. Changing the subnet mask requires updating the settings on every device in the network or forcing them to renew their DHCP lease.