Skip to main content

IPv4 guide

How Many Bits Are in an IPv4 Address? 32-Bit Format Explained

How many bits are in an IPv4 address?

An IPv4 address is exactly 32 bits long. Those 32 bits are divided into four 8-bit octets. In dotted-decimal notation, each octet appears as a number from 0 to 255, separated by periods.

The familiar text 192.0.2.25 is one way to display the address. The computer represents the same value as 32 binary digits. Leading zeros matter in a full 8-bit binary octet even though they are not written in dotted decimal.

A correct 32-bit IPv4 example

Converting 192.0.2.25 from decimal octets to binary
OctetDecimal8-bit binary
First19211000000
Second000000000
Third200000010
Fourth2500011001

Put the four octets together and the complete mapping is:

11000000.00000000.00000010.00011001 = 192.0.2.25

Each binary group has eight digits, so the address has 8 + 8 + 8 + 8 = 32 bits. The range 192.0.2.0/24 is reserved for documentation, which makes this example suitable for explanations rather than a claim about a live endpoint.

Address length, prefix length, and subnet mask are different

Every IPv4 address remains 32 bits long. A CIDR prefix length says how many of those bits identify the network prefix for a route or block. It does not change the address format.

Related IPv4 notation and what each value means
NotationMeaningWhat it does not mean
192.0.2.25One 32-bit IPv4 address written as four decimal octetsA prefix length or block size
/24The first 24 bits are the prefix; 8 bits remain to vary inside the blockThat the IPv4 address itself is only 24 bits
255.255.255.0The dotted-decimal subnet mask equivalent to a contiguous /24An address-count or reachability guarantee
192.0.2.0/24A CIDR prefix containing 2^(32-24) = 256 total address valuesThat all 256 values are assignable, public, routed, or available

For a /24, the remaining 8 bits can form 256 combinations. Traditional IPv4 subnetting often reserves the all-zero and all-one values as the subnet identifier and directed-broadcast address, leaving 254 conventional host addresses. That shortcut is not universal: point-to-point /31 links and exact /32 host routes have different semantics. Use the applicable protocol and network design instead of subtracting two from every block automatically.

The subnetting guide explains CIDR boundaries and masks in more detail.

Why 32 bits produce 4,294,967,296 IPv4 values

Each bit can be either 0 or 1. A 32-bit field therefore has 2^32, or exactly 4,294,967,296, possible bit patterns. This is the mathematical size of the IPv4 address space.

That number is not the count of public addresses a person or business can use. Some ranges are reserved for private networks, loopback, link-local communication, multicast, documentation, benchmarking, and other special purposes. Other addresses are allocated or assigned through Internet number registries, may be routed under provider policy, or may be unavailable for transfer or lease. “Possible,” “globally routable,” “allocated,” “available,” and “assignable to a host” describe different facts.

See how many IPv4 addresses exist for the full address-space calculation and the difference between total, public, and available capacity.

IPv4 bits compared with IPv6 bits

IPv4 and IPv6 address lengths and notation
PropertyIPv4IPv6
Address length32 bits128 bits
GroupingFour 8-bit octetsEight 16-bit hexadecimal groups before permitted compression
Typical text192.0.2.252001:db8::25
Mathematical address space2^32 values2^128 values
Prefix example192.0.2.0/242001:db8::/32

IPv6 has a much larger address field, but that does not make every value globally routable or remove the need for address planning, routing, firewalls, DNS, monitoring, or abuse controls. IPv4 and IPv6 are separate protocols that commonly coexist. The IPv4 and IPv6 comparison covers their operational differences.

Common mistakes when counting IPv4 bits

  • Dropping leading binary zeros: Decimal 2 is 00000010 when shown as a complete 8-bit octet, not just 10.
  • Confusing /24 with address length: The address is still 32 bits. The slash value marks the prefix portion.
  • Counting the IPv4 packet header: A base IPv4 header is a separate protocol structure. Its size does not change the 32-bit source and destination address fields.
  • Assuming classful boundaries: Modern routing uses CIDR prefix lengths. An address beginning with a particular decimal value does not by itself supply the intended subnet or route.
  • Treating total values as usable inventory: Block math does not establish registry authority, public routing, market availability, reputation, or suitability for a service.

For a wider introduction to format, public and private scope, and operational limits, read what an IPv4 address is.

IPv4 bit-length FAQ

How many bits are in an IPv4 address?

An IPv4 address is exactly 32 bits long. It consists of four octets, and each octet contains 8 bits.

How many bytes are in an IPv4 address?

Four bytes. One byte contains 8 bits, so 4 × 8 = 32 bits.

How many bits are in each IPv4 octet?

Each octet contains 8 bits and can represent a decimal value from 0 through 255.

Does /24 mean an IPv4 address has 24 bits?

No. The address is still 32 bits. /24 means the first 24 bits form the network prefix, leaving 8 bits to vary within that CIDR block.

How many possible IPv4 addresses are there?

A 32-bit field has 2^32, or 4,294,967,296, possible values. Fewer are available for ordinary public use because many are reserved, allocated, assigned, unrouted, or otherwise unavailable.

Primary standards and registries

Planning public IPv4 capacity

Bit count is only the first calculation. Before using a public block, define the required prefix size, holder or lease authority, origin ASN, upstream acceptance, RPKI and IRR responsibilities, DNS, reputation evidence, abuse handling, monitoring, renewal, and return path. For a time-bound requirement, review the managed IPv4 leasing workflow after the technical scope is clear.

Tags

  • #ipv4