An IPv4 address is 32 bits long, divided into four 8-bit sections

An IPv4 address contains exactly 32 bits of information. Those bits are grouped into four octets — that is, four sections of 8 bits each. When you see an address like 192.168.1.100, each number between the dots represents one 8-bit octet. The first octet (192) is bits 1 through 8, the second (168) is bits 9 through 16, and so on through bit 32.

Each 8-bit octet can hold a value from 0 to 255, because 2 to the power of 8 equals 256 possible combinations. That is why you will never see a number larger than 255 in any position of an IPv4 address. The entire 32-bit address can represent roughly 4.3 billion unique addresses — a number that made sense when IPv4 was designed in the 1980s, but which ran out decades later.

Understanding this structure matters for home networking because it determines how your router divides your local network into usable addresses. The bits are not just a technical detail — they control which devices can talk to each other directly and which must go through a gateway.

Key Takeaways

  • IPv4 addresses are 32 bits total, split into four 8-bit octets, which is why each section ranges from 0 to 255.
  • The first portion of the address (determined by the subnet mask) identifies your network; the remaining bits identify individual devices on that network.
  • A /24 subnet mask, common in home networks, uses 24 bits for the network and leaves 8 bits for device addresses, allowing up to 254 usable addresses.
  • Knowing how many bits your subnet mask uses helps you understand which devices are on your local network and which require routing through your gateway.

How the 32 bits split between network and device address

Not all 32 bits serve the same purpose. The subnet mask determines how many of those bits identify your network and how many identify individual devices within it. In a typical home network with a subnet mask of 255.255.255.0 (written as /24 in shorthand), the first 24 bits identify the network, and the last 8 bits identify the device.

If your router assigns you the network 192.168.1.0/24, that means 192.168.1 is your network portion, and the final octet is where device addresses vary. Your router itself might be 192.168.1.1, your first computer 192.168.1.10, your phone 192.168.1.50, and so on. All devices sharing those first 24 bits are on the same local network and can reach each other directly without going through a gateway.

A different subnet mask uses a different split. A /16 network uses 16 bits for the network and 32 minus 16 equals 16 bits for devices — allowing thousands of addresses on a single network. A /30 network uses 30 bits for the network and only 2 bits for devices, allowing just 2 usable addresses. Your home router almost always uses /24, but understanding the concept helps you read network documentation and troubleshoot connectivity issues.

Why 32 bits was chosen and what it means for modern networks

IPv4 was standardized in 1981 when the internet was a small research network. Designers chose 32 bits as a balance between address space and routing efficiency — enough to accommodate growth they could foresee, but not so large that routers would struggle to process addresses. At the time, 4.3 billion addresses seemed like an unlimited supply.

That assumption proved wrong. By the early 2000s, the internet had grown far beyond what 32 bits could support. IPv6, the replacement protocol, uses 128 bits per address — enough for roughly 340 undecillion addresses, a number so large it has no practical upper limit. However, IPv6 adoption has been slow, and most home networks still run on IPv4.

For your home network, the 32-bit limit is not a practical problem. Your router uses Network Address Translation (NAT) to let dozens or hundreds of devices share a single public IPv4 address. Internally, your devices use private IPv4 addresses from ranges reserved for local networks (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16). The 32-bit structure still works fine for this purpose.

Reading subnet masks and CIDR notation

When you see notation like /24 or /16, that number tells you how many of the 32 bits are used for the network portion. A /24 means 24 bits for the network, leaving 8 bits for devices. A /25 means 25 bits for the network, leaving 7 bits for devices — which allows only 128 addresses instead of 256.

The traditional subnet mask notation (255.255.255.0) conveys the same information but in a less compact form. Each octet in the subnet mask is either 255 (all 8 bits used for the network) or a number like 128, 192, 224, or 240 (some bits used for the network, some for devices). Converting between the two formats is useful when reading router settings or network documentation, but the CIDR notation (/24) is faster to write and understand.

Your router's configuration page will show both formats. If you see 255.255.255.0, you know that is a /24 network. If you see 255.255.255.128, that is a /25 network. Learning to recognize these patterns helps you understand your network's structure without needing to calculate binary values.

How bit structure affects your network's security

The 32-bit structure and subnet mask determine which devices can reach each other without going through your router's firewall. Devices on the same network (same network bits) can communicate directly. Devices on different networks must go through a gateway, where your router can explore rules and filtering.

In a home network, this usually means all your devices are on the same /24 network, so they can all reach each other directly. That is why a compromised device on your network can potentially access files on other devices — they are all on the same local segment. Firewalls on individual devices and proper access controls on shared folders provide the actual protection, not the network structure itself.

Understanding the 32-bit structure helps you recognize when a device is on your local network versus connecting from outside. If a device has an address starting with 192.168.1, it is local. If it has an address from a different range, it is either on a different network or connecting through a VPN. This distinction matters when you are deciding which devices should have direct access to sensitive resources.

Calculating usable addresses from bit allocation

Once you know how many bits are allocated to devices, you can calculate how many addresses are available. Take the number of device bits and raise 2 to that power. A /24 network has 8 device bits, so 2 to the power of 8 equals 256 total addresses. However, two of those are reserved: the network address itself (all device bits set to 0) and the broadcast address (all device bits set to 1). That leaves 254 usable addresses for actual devices.

A /25 network has 7 device bits, so 2 to the power of 7 equals 128 total addresses, minus 2 reserved, leaving 126 usable. A /30 network has 2 device bits, so 2 to the power of 2 equals 4 total addresses, minus 2 reserved, leaving only 2 usable — which is why /30 networks are used for point-to-point links between routers, not for general device networks.

For a home network, you will almost always see /24, which gives you 254 usable addresses. That is more than enough for a typical household. If you ever need to set up a smaller network segment for testing or isolation, understanding this calculation helps you choose the right subnet mask.

Frequently Asked Questions

Why is it 32 bits and not some other number?

IPv4 was designed in 1981 when the internet was much smaller. Designers chose 32 bits as a practical balance — large enough to support millions of networks, but small enough for routers to process efficiently. The choice made sense at the time but proved too limiting as the internet grew. IPv6 uses 128 bits to avoid this problem.

Can I change the subnet mask on my home network?

Yes, but there is rarely a reason to. Your router's default /24 subnet mask provides 254 usable addresses, which is more than any home network needs. Changing it could break device discovery and cause connectivity problems. Leave it at the default unless you have a specific reason to change it.

What happens if two devices have the same IPv4 address?

They will conflict, and both will have connectivity problems. Your router assigns addresses through DHCP, which prevents this automatically. If you manually assign addresses, you must may support no two devices on the same network have identical addresses. Most routers warn you if they detect a duplicate.

Does understanding bits help me find my network?

It helps you understand which devices can reach each other directly and which must go through your router's firewall. That knowledge is useful when deciding where to place sensitive devices or when troubleshooting unexpected connectivity. The actual security comes from firewalls and access controls, not from the bit structure itself.

Is IPv4 going away soon?

IPv4 is not going away in the near future, despite IPv6 being available for decades. Most networks still use IPv4, and your home router will continue supporting it. IPv6 adoption is slow because it requires changes across the entire internet infrastructure. For home networking, IPv4 remains the standard.