How Many Bits Are in an IPv4 Address?

An IPv4 address is 32 bits long. That's the foundational fact behind nearly everything you encounter when setting up a network, troubleshooting connectivity, or reading about internet infrastructure. But what those 32 bits actually mean — and why the number matters — is worth understanding properly.

Breaking Down the 32-Bit Structure

IPv4 addresses are divided into four groups of 8 bits, called octets. Each octet is separated by a dot, which is why addresses look like this: 192.168.1.1.

Each octet can represent a value from 0 to 255, because 8 bits give you 2⁸ = 256 possible values (0 through 255). Four octets multiplied together give you the full 32-bit address space.

ComponentDetail
Total bits32
Number of octets4
Bits per octet8
Values per octet0–255
Total possible addresses~4.29 billion (2³²)

So when you see 192.168.0.1, you're really looking at four binary numbers — 11000000.10101000.00000000.00000001 — written in decimal for human readability.

Why 32 Bits Defines the Limits of IPv4

The 32-bit design was established in RFC 791 in 1981. At the time, roughly 4.29 billion unique addresses seemed like more than enough. The internet was a research project, not a global consumer network.

That assumption didn't hold. As devices multiplied — computers, phones, tablets, smart TVs, IoT sensors — the pool of available IPv4 addresses became exhausted. The Internet Assigned Numbers Authority (IANA) officially ran out of unallocated IPv4 blocks in 2011.

The 32-bit ceiling is a hard architectural limit. It's not a setting that can be changed or expanded — it's baked into the protocol itself.

How the Address Space Is Divided

Not all 4.29 billion addresses are publicly routable. The 32-bit space is carved into ranges with specific purposes:

  • Private address ranges (like 10.x.x.x, 172.16.x.x–172.31.x.x, and 192.168.x.x) are reserved for internal networks and are not routed on the public internet
  • Loopback addresses (127.x.x.x) refer to the local device itself
  • Multicast and reserved ranges cover broadcast and experimental use

This is why your home router assigns addresses like 192.168.1.x to your devices — those are private addresses, and your router uses NAT (Network Address Translation) to map them to a single public IP. NAT is one of the primary workarounds that extended IPv4's usable lifespan well past its theoretical exhaustion point.

Network vs. Host: How Subnetting Uses Those 32 Bits

Within any IPv4 address, the 32 bits are split into two logical parts:

  • Network portion — identifies which network the address belongs to
  • Host portion — identifies the specific device on that network

The subnet mask determines where that boundary falls. A subnet mask of 255.255.255.0 (written as /24 in CIDR notation) means the first 24 bits identify the network and the remaining 8 bits identify individual hosts — allowing up to 254 usable host addresses on that subnet.

Changing the subnet mask shifts that boundary. A /16 mask gives you 16 bits for hosts (up to 65,534 devices). A /30 mask leaves only 2 usable host addresses — common for point-to-point links between routers.

🔢 The flexibility of subnetting is entirely dependent on those 32 bits being divisible in different ways. It's what makes both a home network with a handful of devices and a corporate network with thousands of endpoints workable within the same protocol.

IPv4 vs. IPv6: The Bit Count Comparison

The exhaustion problem is exactly why IPv6 was developed. IPv6 uses 128-bit addresses — quadruple the bit length of IPv4.

FeatureIPv4IPv6
Address length32 bits128 bits
Total addresses~4.29 billion~340 undecillion
FormatDecimal, dotted (192.168.1.1)Hexadecimal, colon-separated (2001:0db8::1)
Subnet maskRequiredBuilt into prefix notation

The jump from 32 to 128 bits isn't just four times more addresses — it's astronomically more. 2¹²⁸ is approximately 340 trillion trillion trillion unique addresses, enough to assign addresses to every atom on Earth's surface many times over. 🌐

What Determines How IPv4 Applies to Your Setup

Knowing that IPv4 uses 32 bits is the technical baseline. What varies by situation:

  • Whether your network is IPv4-only, IPv6-only, or dual-stack — many modern networks run both simultaneously
  • How your ISP allocates public IPs — some residential customers share a single public IP across many users via carrier-grade NAT (CGNAT)
  • Your subnet configuration — home networks typically use /24 subnets; enterprise environments use more granular subnetting based on department size and security segmentation
  • Whether you need static or dynamic addressing — DHCP dynamically assigns addresses from a pool; static assignment pins a specific IP to a device, which matters for servers, printers, and network hardware
  • Router and device capabilities — older hardware may handle IPv6 poorly or not at all, keeping some networks stuck on IPv4

A home user with a single router and a handful of devices experiences IPv4 very differently than a network administrator managing hundreds of subnets across multiple locations. The 32-bit structure is the same in both cases — but how those bits are allocated, masked, and translated varies considerably depending on scale, infrastructure, and design choices.