Every device that communicates on an IPv4 network needs an address, much like every home on a street needs a number. But instead of being written on an envelope, an IPv4 address is built from bits: tiny binary digits that computers use to store and route information. Understanding how many bits are in an IPv4 address is a small detail with big implications for networking, internet growth, and the way data finds its destination.
TLDR: An IPv4 address is 32 bits long. Those 32 bits are usually written as four decimal numbers separated by dots, such as 192.168.1.1. Because 32 bits can create about 4.3 billion unique combinations, IPv4 has a large but limited address space. This limitation is one of the main reasons IPv6 was created.
The Short Answer: IPv4 Uses 32 Bits
An IPv4 address contains exactly 32 bits. A bit is the smallest unit of digital information and can have one of two values: 0 or 1. Since IPv4 uses 32 of these binary digits, each address is essentially a 32-character binary number.
For example, the IPv4 address:
192.168.1.1
can be represented in binary as:
11000000.10101000.00000001.00000001
The dots are not part of the actual binary value; they are included to make the address easier for humans to read. Without them, the address would simply be a continuous sequence of 32 bits.
Why IPv4 Addresses Are Written in Four Parts
Although computers work with IPv4 addresses as 32-bit binary numbers, humans usually see them in dotted decimal notation. This format divides the 32 bits into four groups of 8 bits. Each 8-bit group is called an octet.
So, an IPv4 address is structured like this:
- 8 bits in the first octet
- 8 bits in the second octet
- 8 bits in the third octet
- 8 bits in the fourth octet
Altogether, that gives us:
8 + 8 + 8 + 8 = 32 bits
Each octet can represent a decimal value from 0 to 255. That is why IPv4 addresses look like four numbers, each within that range. A valid IPv4 address might be 10.0.0.5, 172.16.254.1, or 8.8.8.8. However, an address like 300.12.4.1 is invalid because 300 cannot fit into 8 bits.
How 8 Bits Become a Number from 0 to 255
To understand why an octet ranges from 0 to 255, it helps to look at binary place values. In an 8-bit number, each bit represents a power of two:
- 128
- 64
- 32
- 16
- 8
- 4
- 2
- 1
If all 8 bits are set to 0, the value is:
00000000 = 0
If all 8 bits are set to 1, the value is:
11111111 = 255
That is because:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255
This is the mathematical reason each section of an IPv4 address cannot go below 0 or above 255.
How Many IPv4 Addresses Are Possible?
Since an IPv4 address has 32 bits, and each bit can be either 0 or 1, the total number of possible combinations is:
232 = 4,294,967,296
That means IPv4 can theoretically provide about 4.3 billion unique addresses. When IPv4 was designed in the early days of the internet, this seemed like a huge number. At the time, nobody expected billions of smartphones, laptops, servers, smart TVs, cameras, game consoles, and sensors to connect to the internet.
However, not all 4.3 billion addresses are available for public use. Some are reserved for special purposes, including private networks, testing, multicast communication, and loopback addresses. For example, addresses starting with 192.168 are commonly used inside home and office networks, while 127.0.0.1 refers to the local device itself.
Image not found in postmetaPublic and Private IPv4 Addresses
One interesting detail about IPv4 is that not every address needs to be unique across the entire internet. Some addresses are used only within private networks. These are called private IPv4 addresses.
Common private IPv4 ranges include:
10.0.0.0to10.255.255.255172.16.0.0to172.31.255.255192.168.0.0to192.168.255.255
Your home router probably gives your phone or computer an address in one of these ranges. These addresses work inside your local network but are not directly reachable from the public internet. To make private addressing practical, routers use a technology called Network Address Translation, or NAT. NAT allows many devices on a private network to share one public IPv4 address.
This clever workaround helped extend the life of IPv4, but it did not change the fundamental fact: an IPv4 address is still only 32 bits.
IPv4 Bits and Subnetting
The 32 bits in an IPv4 address are often divided into two conceptual parts: the network portion and the host portion. The network portion identifies the network, while the host portion identifies a specific device on that network.
For example, in a typical home network using:
192.168.1.0/24
the /24 means the first 24 bits are used for the network portion. The remaining 8 bits are available for host addresses. This is known as CIDR notation, and it is a compact way to describe how many bits belong to the network.
In simple terms:
- /8 means 8 network bits
- /16 means 16 network bits
- /24 means 24 network bits
- /32 refers to one specific IPv4 address
Subnetting is the practice of dividing larger networks into smaller ones. It is one of the most important uses of IPv4 bit structure because it helps organize networks efficiently and control traffic flow.
Why 32 Bits Became a Limitation
A 32-bit address space sounded enormous decades ago, but the internet grew faster than expected. As more people, businesses, and devices came online, the supply of available public IPv4 addresses began to run out.
This shortage did not break the internet, but it did create complications. Organizations had to conserve addresses, use NAT more heavily, and buy or transfer IPv4 address blocks. Cloud computing and mobile networks added even more pressure.
The long-term solution is IPv6, which uses 128-bit addresses instead of 32-bit addresses. That creates an unimaginably larger address space. While IPv4 has about 4.3 billion possible addresses, IPv6 has enough addresses to support the modern internet many times over.
So, How Many Bits Are in an IPv4 Address?
The answer is simple but important: an IPv4 address is 32 bits long. Those 32 bits are divided into four 8-bit octets and commonly displayed as four decimal numbers separated by dots. This format makes addresses easier to read, remember, and configure.
Behind every familiar IPv4 address is a binary structure that routers and computers use to move data across networks. Whether you are troubleshooting a home connection, studying networking, or learning how the internet works, remembering that IPv4 equals 32 bits is a useful foundation. It explains the address format, the 0-to-255 range in each octet, the total number of possible addresses, and the reason the world eventually needed IPv6.