IPv4 vs IPv6

IntermediateAbout 10 minNetworks & systems

Every device on the internet needs an address. Here's why we had to invent a second kind.

What Is an IP Address?

Every device connected to the internet — your phone, your laptop, a server halfway across the world — needs a unique address, the same way every house needs a unique street address for mail to find it. This is called an IP address (Internet Protocol address). Underneath, like everything else in computing, it's just binary.

IPv4: The Original Design

When the modern internet's addressing system was designed in the early 1980s, each address was made of 32 bits. You've already seen what that means: 32 bits gives you 2 to the power of 32 possible values.

That's 4,294,967,296 — about 4.3 billion possible addresses.

An IPv4 address is usually written as four numbers separated by dots — like 192.168.1.1. Each of those numbers is actually one byte (8 bits), so the whole address is really just 32 bits in a more readable form. That's also why each number is always between 0 and 255 — the exact range a single byte can hold, as you saw back in Reading a Byte.

192
11000000
168
10101000
1
00000001
1
00000001

In 1981, 4.3 billion felt limitless. Computers were rare and expensive, confined mostly to universities, governments, and large companies. Nobody was imagining a future where a lightbulb, a doorbell, or a wristwatch might need its own address.

The Problem: Running Out of Room

Fast forward a few decades. Personal computers, then smartphones, then smart TVs, doorbells, fitness trackers, and countless other devices all needed their own address to join the internet. 4.3 billion addresses — once unthinkably large — started running out.

This is the same doubling principle you've already seen: every extra bit doubles how many values you can represent. 32 bits sounded huge, but it's still a fixed number. Once the number of devices in the world caught up to it, there was nowhere left to grow.

IPv6: Solving It With Scale

The fix wasn't to add a few more bits — it was to add a lot more. IPv6 addresses use 128 bits instead of 32.

Because each extra bit doubles the address space, jumping from 32 bits to 128 bits doesn't just make the space bigger — it makes it almost incomprehensibly larger:

StandardBitsPossible Addresses
IPv432~4.3 billion
IPv6128~340 undecillion (340 followed by 36 zeros)
IPv4
~4.3 billion
IPv6
~340 undecillion

Illustrative, not to scale — IPv4's true share would be far too small to see.

To put 340 undecillion in perspective: it's roughly enough to assign a unique address to every grain of sand on Earth — many times over — with room to spare.

Written Differently, Too

128 bits is a lot to write out in binary — 128 digits long. So IPv6 addresses are written in hexadecimal instead, the same shorthand you met on the Binary ↔ Hex ↔ Decimal page. A real IPv6 address looks like this:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Take just one group from that address, 8a2e — each of its hex digits is still just a 4-bit binary nibble underneath:

8
1000
A
1010
2
0010
E
1110

Each group of four hex digits represents 16 bits — exactly the kind of hex-to-binary relationship you've already seen, just applied at a much larger scale.

Why This Matters: Designing for Growth

This is a good example of a much bigger idea in computing: scalability — designing a system so it can keep working well even as it grows far beyond what its creators originally expected.

The early internet's designers weren't wrong to use 32 bits — it was more than enough for what existed at the time. But a truly scalable system has to plan for growth it can't fully predict. IPv6 exists because the internet's open, standardized design let new devices keep joining for decades — and eventually, that same openness meant it needed a fundamentally bigger address space to keep up.

This same idea — building room to grow before you desperately need it — shows up everywhere in computing: databases, network infrastructure, even the way software is architected from day one.

Check your understanding

5 quick questions. Pick one answer for each — you'll see why straight away.

  1. How many bits are in an IPv4 address?

  2. In the address 192.168.1.1, why is every number between 0 and 255?

  3. Why was IPv6 needed?

  4. IPv6 uses 128 bits instead of 32. How many more addresses does that give?

  5. How are IPv6 addresses usually written?