An IPv4 address is made of 32 bits, divided into four groups of 8 bits each

Every device on the internet has an IPv4 address — a unique number that identifies it on a network. That address is built from 32 bits total, which is why IPv4 is sometimes called a 32-bit addressing system. Those 32 bits are split into four sections of 8 bits each, and each section is converted to a decimal number between 0 and 255. That's why you see IPv4 addresses written as four numbers separated by dots, like 192.168.1.1 or 8.8.8.8.

Each group of 8 bits is called an octet because it contains eight binary digits. When you see an IPv4 address, you're looking at four octets displayed in decimal form instead of binary. The first octet identifies the network class and general location, while the remaining octets narrow down to your specific device or subnet. Understanding this structure matters because it determines how many devices can exist on your network and which addresses your router can assign.

Key Takeaways

  • IPv4 addresses contain 32 bits total, split into four 8-bit sections called octets.
  • Each octet converts to a decimal number from 0 to 255, which is why addresses look like 192.168.1.1.
  • The first octet determines the address class and tells you roughly how many devices that network can support.
  • Your subnet mask uses the same 32-bit structure to tell your device which part of the address identifies the network and which part identifies individual devices.

How the 32 bits break down into four octets

Each octet is 8 bits, and 8 bits can represent 256 different values (0 through 255). When you write an IPv4 address in decimal notation, you're converting each 8-bit group from binary to a number humans can read. For example, the address 192.168.1.1 in binary is actually 11000000.10101000.00000001.00000001 — but that's unwieldy, so we use the decimal version instead.

The position of each octet matters. The first octet (the leftmost number) carries more weight in identifying the overall network. The last octet (the rightmost number) usually identifies individual devices on that network. This is why your home router typically assigns addresses like 192.168.1.2, 192.168.1.3, and so on — the first three octets stay the same, and only the last one changes as you add devices.

Why 32 bits limits how many addresses exist

With 32 bits total, there are 2 to the 32nd power possible IPv4 addresses — that's about 4.3 billion unique addresses. That seemed like plenty when IPv4 was designed in the 1980s, but the internet has grown far beyond that. Today, many organizations run out of available IPv4 addresses and have to reuse them on separate networks or switch to IPv6, which uses 128 bits and supports vastly more addresses.

Your home network doesn't use all 4.3 billion addresses. Instead, your router uses a subnet mask to divide the 32 bits into two parts: one part identifies your network, and the other part identifies devices on that network. A common home subnet mask is 255.255.255.0, which means the first three octets (24 bits) identify the network, and the last octet (8 bits) identifies individual devices. That gives you room for 254 usable device addresses on a typical home network (256 minus 2, because one address is reserved for the network itself and one for broadcast).

How your device uses the 32-bit address to communicate

When your computer sends data to another device, it uses the 32-bit address to figure out whether the destination is on the same local network or somewhere else on the internet. Your device compares its own address to the destination address using the subnet mask. If the network portion (the bits covered by the subnet mask) matches, the device sends the data directly to the other device on your local network. If it doesn't match, the device sends the data to your router's gateway address instead, and the router forwards it toward the internet.

This is why your subnet mask is just as important as your IP address — together, they determine which devices your computer can reach directly and which ones require a router to relay messages. If your subnet mask is wrong, your device might try to send data directly to a device it can't actually reach, or it might send local traffic to the router unnecessarily.

The difference between IPv4's 32 bits and IPv6's 128 bits

IPv6 addresses use 128 bits instead of 32, which means they can represent 2 to the 128th power possible addresses — a number so large it's difficult to grasp. IPv6 was created specifically because the world was running out of IPv4 addresses. However, IPv4 is still the dominant protocol on most home networks and many corporate networks, so you'll encounter 32-bit addresses far more often than 128-bit ones.

Your device might actually use both IPv4 and IPv6 at the same time. Your router can assign IPv4 addresses to your devices for local communication and also provide IPv6 addresses for internet traffic. Over time, IPv6 adoption is increasing, but the transition from IPv4 is slow because so much existing infrastructure still relies on 32-bit addresses.

What the address classes tell you about the first octet

The first octet of an IPv4 address falls into one of five classes, and the value of that octet tells you which class it is. Class A addresses start with 1 to 126 in the first octet and are used for very large networks. Class B addresses start with 128 to 191 and are used for medium-sized networks. Class C addresses start with 192 to 223 and are used for smaller networks — this is the class your home router typically uses. Classes D and E are reserved for special purposes like multicast and experimental use.

Your home network almost certainly uses Class C addresses, which is why your router assigns addresses starting with 192.168. The 192 in the first octet tells you immediately that this is a Class C address. Understanding these classes helps you recognize what kind of network you're looking at, though in practice, modern networks often ignore these old class boundaries and use CIDR notation (Classless Inter-Domain Routing) instead, which is more flexible.

How subnet masks use the same 32 bits

A subnet mask is also 32 bits long, written in the same four-octet format as an IPv4 address. A typical home subnet mask is 255.255.255.0, which in binary is 11111111.11111111.11111111.00000000. The 1s in the mask represent the network portion of the address, and the 0s represent the device portion. Your device uses this mask to determine which part of an IP address identifies the network and which part identifies the individual device.

When you see a subnet mask like 255.255.255.0, it means the first 24 bits (three octets) identify the network, and the last 8 bits (one octet) identify devices on that network. This is sometimes written as /24 in CIDR notation, where the number represents how many bits are used for the network. A /24 network can have up to 254 usable device addresses. A /25 network (255.255.255.128) splits the last octet in half, giving you two smaller networks of 126 devices each.

Frequently Asked Questions

Why is IPv4 called 32-bit if there are four octets?

Each octet is 8 bits, and 4 octets × 8 bits = 32 bits total. The term "32-bit" refers to the total number of bits in the entire address, not the size of each section. IPv4 is sometimes called a "32-bit addressing scheme" to distinguish it from IPv6, which uses 128 bits.

Can I change the 32-bit structure of an IPv4 address?

No, the 32-bit structure is fixed in the IPv4 protocol itself. However, you can change your subnet mask to divide those 32 bits differently between the network and device portions. Your router's configuration lets you adjust the subnet mask, which changes how many devices can be on your network.

Does my home network use all 32 bits?

Yes, every IPv4 address uses all 32 bits. Your home network typically uses a /24 subnet mask, which means 24 bits identify your network and 8 bits identify devices. All 32 bits are always present in every address, but the subnet mask determines which bits matter for routing.

What happens if two devices have the same 32-bit address?

If two devices on the same network have the same IPv4 address, both will have trouble communicating. This is called an IP conflict or IP address collision. Your router won't be able to tell which device should receive incoming data, and both devices may lose connectivity. This is why DHCP (the system that assigns addresses automatically) exists — to prevent conflicts by tracking which addresses are in use.

Is 32 bits enough for the internet to keep growing?

No, which is why IPv6 was created. The 4.3 billion possible IPv4 addresses are already exhausted in many regions, and organizations now use techniques like NAT (Network Address Translation) to reuse addresses across separate networks. IPv6's 128 bits provide enough addresses for the foreseeable future, but the transition is slow because so much infrastructure still depends on IPv4.