How Large Are IPv4 Addresses? | Size Explained In Plain Terms

An IPv4 address is 32 bits long (4 bytes) and is usually written as four 0–255 numbers separated by dots.

If you’ve ever seen something like 192.168.1.25, you’ve seen an IPv4 address in its most common outfit: dotted decimal. People call it an “IP address,” but the size question can get slippery because the same address shows up in different places and formats.

So let’s pin it down. When someone asks how large IPv4 addresses are, they usually mean one of three things: the size on the wire inside a packet, the size in memory or a database field, or the size as human-readable text. Each one matters in a different way.

What “Large” Means For An IPv4 Address

IPv4 is a numbering system. The address is the number. In the IPv4 standard, that number is 32 bits long. Bits are the raw unit; everything else is a wrapper around those same 32 bits.

That 32-bit design caps the total count of unique IPv4 addresses at 232 = 4,294,967,296. That’s the whole pool, before you subtract ranges reserved for special use, routing rules, and allocation policies.

When you store or send an IPv4 address, you’re moving those same 32 bits around. The format changes. The underlying size does not.

How Large Are IPv4 Addresses? In Bits, Bytes, And Text

Bit Length: 32 Bits

IPv4 addresses are 32 bits. That’s not a convention or a habit. It’s part of the protocol definition. In the IPv4 header, the Source Address field is 32 bits and the Destination Address field is 32 bits as well, matching the address size. RFC 791 (Internet Protocol) spells out that each internet address is 32 bits (4 octets).

Byte Length: 4 Bytes

Computers usually group bits into bytes (8 bits per byte). Since 32 ÷ 8 = 4, an IPv4 address is 4 bytes. If a system stores addresses in a fixed binary field, 4 bytes is the clean, direct size.

Text Length: 7 To 15 Characters

The dotted-decimal string is a display format. It breaks the 32 bits into four 8-bit chunks (octets), then prints each octet as a decimal number from 0 to 255, separated by dots.

That means the text length varies. The shortest dotted-decimal address is 0.0.0.0 (7 characters). The longest is 255.255.255.255 (15 characters). If you add CIDR notation like /24, tack on 3 more characters for most masks, or up to 3 for /0 through /32 plus the slash.

Why IPv4 Uses 32 Bits

IPv4 was designed when networks were smaller and the public internet was still taking shape. A 32-bit address space gave a huge range for that era, while keeping headers compact enough for the hardware and links of the time.

The choice shows up all over IPv4’s structure. The base header has fixed fields that add up neatly, and the address fields slot in as two 32-bit values: source and destination. That consistency makes routing and forwarding fast.

Still, the world grew. The 32-bit space ran out faster than the early designers expected, which is why NAT, address sharing, and IPv6 became everyday topics in network operations.

Octets, Binary, And The Dotted Decimal You See Every Day

Here’s the core mapping:

  • 32 bits total
  • 4 octets (each octet is 8 bits)
  • Each octet prints as 0–255

Say you have the address 203.0.113.7. Each number is one octet. Under the hood, each octet is an 8-bit binary value. The device doesn’t “think” in dotted decimal; it just stores and compares the 32-bit value.

That’s why two different strings can still refer to the same 32-bit number if software accepts alternate notations. Most modern tools stick to dotted decimal for clarity.

Where The 32 Bits Live In Real Systems

Inside Packets On The Wire

In an IPv4 packet, the address fields are part of the IPv4 header. The base IPv4 header is 20 bytes long when there are no options. The two addresses take 8 of those bytes total: 4 bytes for source, 4 bytes for destination.

That’s one reason the “4 bytes” view matters. If you’re sizing packet captures, building parsers, or reading raw frames, the address is fixed-length binary.

In Memory And Databases

Many systems store IPv4 addresses as a 32-bit integer or as a 4-byte binary blob. If you see types like uint32, INTEGER, or a 4-byte BINARY field, that’s the same 32-bit value in a tidy container.

Text storage is common too, especially in logs and analytics pipelines. That’s easier for humans to scan, but it costs more bytes per row and it changes length from address to address.

In Config Files, Logs, And APIs

Text wins in config files because you can read it at a glance. Logs use text for the same reason. APIs often accept both forms: dotted decimal for input/output, and binary for internal work.

If you’re building a system that handles a lot of addresses, storing the 4-byte form saves space and speeds up comparisons. If you’re building a tool for humans, text is friendlier.

Subnet Masks And CIDR: The Address Stays 32 Bits

Subnetting adds a prefix length (CIDR) or a subnet mask, but it doesn’t change the address size. The address is still 32 bits. CIDR just says how many of those bits describe the network part.

When you write 192.168.1.25/24, you’re pairing two values:

  • The IPv4 address (32 bits)
  • The prefix length (24, a number from 0 to 32)

The prefix length is not “part of” the address. It’s metadata that tells routing and host configuration how to interpret the address for a given network.

That’s also why the same address can belong to different networks in different contexts. A laptop could be 10.0.0.25/8 on one network and 10.0.0.25/24 on another. Same 32-bit address, different network boundary.

Table: IPv4 Address Representations And Their Storage Size

The same IPv4 address can be carried in multiple forms. This table shows how the size changes with the format, while the underlying address stays 32 bits.

Representation What It Looks Like Size You’re Storing/Using
Binary (raw address) 32-bit value 32 bits (4 bytes)
Four octets 4 chunks of 8 bits 32 bits (4 bytes)
Dotted decimal text 203.0.113.7 7–15 characters
Text with CIDR 203.0.113.7/24 9–18 characters
32-bit integer (unsigned) 3405803783 32 bits (4 bytes)
Hex (human-facing) CB.00.71.07 style Varies as text; still 32 bits in value
Packed network order bytes 0xCB 0x00 0x71 0x07 4 bytes
Database text column 255.255.255.255 Up to 15 bytes (plus row overhead)

Reserved And Allocated Space: Why “Total” Differs From “Usable”

The math says 4,294,967,296 total addresses. Real usage is lower because chunks of the space have dedicated roles. Some ranges are set aside for private networks, loopback, multicast, documentation, and other protocol needs.

On top of that, address space is allocated and tracked through registries. If you’re checking how IPv4 blocks are assigned and recorded at the global level, the IANA IPv4 Address Space registry lists how the /8 blocks are designated and distributed.

This is where the size question meets reality: the address is still 32 bits, but policy and special-purpose ranges shape what you can use on the public internet.

Packet Overhead: The Address Is Small, The Header Adds More

People sometimes ask about “IPv4 size” when they’re chasing bandwidth overhead. That’s a different question than address size, but it’s tied to it.

An IPv4 packet header is at least 20 bytes. Two IPv4 addresses account for 8 bytes of that header. The rest is fields like TTL, protocol number, fragmentation fields, and checksums. If options are present, the header can grow beyond 20 bytes, up to 60 bytes.

So the address itself is compact. The protocol wrapper is where the extra bytes come from.

Common Misreads About IPv4 Address Size

“My IPv4 Address Has 12 Digits, So It Must Be 12 Bytes”

The dotted-decimal string is not the stored form. It’s a printed form. The digits are characters, and characters take a byte each in common encodings like ASCII and UTF-8. That can be 7 to 15 bytes just for the characters, plus any quotes, commas, or JSON structure wrapped around it.

“CIDR Makes The Address Bigger”

CIDR adds a prefix length to the notation. It does not change the 32-bit address. It’s like writing a street address plus an apartment number. Same building, extra detail.

“IPv4 Is 4 Numbers, So It’s 4 Bits”

Each of the four numbers represents 8 bits, not 1 bit. Four octets is 32 bits total. The “4” in IPv4 is the protocol version number, not the address length.

Table: Quick Size Checks You Can Use In Code And Tools

When you’re debugging or designing storage, these checks help you confirm what you’re holding.

What You’re Holding Fast Check Size Result
Binary IPv4 address Length equals 4 bytes 32 bits
Dotted decimal string Between 7 and 15 characters Varies as text
Dotted decimal + CIDR Between 9 and 18 characters Varies as text
Integer form Fits in unsigned 32-bit range 0 to 4,294,967,295
Subnet mask (binary) Length equals 4 bytes 32 bits
Prefix length Integer from 0 to 32 Small scalar value

Practical Takeaways For Storage, Logging, And Network Work

If you’re choosing a storage format, start with your goal. If you need compact and fast comparisons, store IPv4 as 4 bytes or a 32-bit integer. If you need readability in plain files, store it as dotted decimal text.

If you’re moving addresses across systems, be consistent about byte order and format conversions. Network protocols use a standard byte order for multi-byte fields, and most libraries handle conversions for you, but it’s still easy to trip over mismatches when you mix raw bytes, integers, and text.

If you’re interpreting “size” as overhead, remember the split: 4 bytes for the address itself, at least 20 bytes for the IPv4 header, plus link-layer headers below it and transport headers above it.

Once you lock in that mental model, the whole topic gets calmer: IPv4 addresses are always 32 bits. Everything else is just a wrapper for display, policy, or transport.

References & Sources